update THANKS
[bpt/guile.git] / NEWS
diff --git a/NEWS b/NEWS
index 2979849..6bebbf6 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -8,10 +8,227 @@ Please send Guile bug reports to bug-guile@gnu.org.
 Note: During the 1.9 series, we will keep an incremental NEWS for the
 latest prerelease, and a full NEWS corresponding to 1.8 -> 2.0.
 
+Changes since the 1.9.15 prerelease:
+
+** Deprecated: primitive properties
+
+The `primitive-make-property', `primitive-property-set!',
+`primitive-property-ref', and `primitive-property-del!' procedures were
+crufty and only used to implement object properties, which has a new,
+threadsafe implementation.  Use object properties or weak hash tables
+instead.
+
+** New syntax: define-once
+
+`define-once' is like Lisp's `defvar': it creates a toplevel binding,
+but only if one does not exist already.
+
+** Added four new sets of fast quotient and remainder operators
+
+Added four new sets of fast quotient and remainder operators with
+different semantics than the R5RS operators.  They support not only
+integers, but all reals, including exact rationals and inexact
+floating point numbers.
+
+These procedures accept two real numbers N and D, where the divisor D
+must be non-zero.  Each set of operators computes an integer quotient
+Q and a real remainder R such that N = Q*D + R and |R| < |D|.  They
+differ only in how N/D is rounded to produce Q.
+
+`floor-quotient' and `floor-remainder' compute Q and R, respectively,
+where Q has been rounded toward negative infinity.  `floor/' returns
+both Q and R, and is more efficient than computing each separately.
+Note that when applied to integers, `floor-remainder' is equivalent to
+the R5RS integer-only `modulo' operator.  `ceiling-quotient',
+`ceiling-remainder', and `ceiling/' are similar except that Q is
+rounded toward positive infinity.
+
+For `truncate-quotient', `truncate-remainder', and `truncate/', Q is
+rounded toward zero.  Note that when applied to integers,
+`truncate-quotient' and `truncate-remainder' are equivalent to the
+R5RS integer-only operators `quotient' and `remainder'.
+
+For `round-quotient', `round-remainder', and `round/', Q is rounded to
+the nearest integer, with ties going to the nearest even integer.
+
+** Improved exactness handling for complex number parsing
+
+When parsing non-real complex numbers, exactness specifiers are now
+applied to each component, as is done in PLT Scheme.  For complex
+numbers written in rectangular form, exactness specifiers are applied
+to the real and imaginary parts before calling scm_make_rectangular.
+For complex numbers written in polar form, exactness specifiers are
+applied to the magnitude and angle before calling scm_make_polar.
+
+Previously, exactness specifiers were applied to the number as a whole
+_after_ calling scm_make_rectangular or scm_make_polar.
+
+For example, (string->number "#i5.0+0i") now does the equivalent of:
+
+  (make-rectangular (exact->inexact 5.0) (exact->inexact 0))
+
+which yields 5.0+0.0i.  Previously it did the equivalent of:
+
+  (exact->inexact (make-rectangular 5.0 0))
+
+which yielded 5.0.
+
+\f
 Changes in 1.9.15 (since the 1.9.14 prerelease):
 
+** Formally deprecate omission of port to `format'
+    
+It used to be that you could omit passing a port to `format', in some
+cases.  This still works, but has been formally deprecated.
+    
+** ECMAScript fixes
+
+Noah Lavine and Kan-Ru Chen noticed and fixed a number of embarrassing
+bugs in object creation, unicode literals in strings, empty function
+bodies, non-breaking whitespace, and numeric literals.
+
+** `(web ...)' changes
+
+*** `parse-uri', `unparse-uri' now called `string->uri', `uri->string'
+    
+*** `uri-decode' takes `#:encoding' keyword argument, not `#:charset'
+
+*** HTTP header representation change
+
+Guile properly garbage-collects symbols, so there's no need to read some
+headers as symbols and some as strings: all header names are symbols
+now.  The same goes for many key-value constructs in headers.  Guile
+parses the challenge/authentication headers now, as well.  Header decl
+objects are no longer exposed to the user.
+
+*** Request and response bodies are always bytevectors
+
+Reading bodies as latin-1 strings was a cute hack, but not general, so
+Guile's only official fetch-me-the-body procedures return bytevectors
+now.
+
+** New procedures: scm_{to,from}_{utf8,latin1}_symbol{n,}
+** New procedures: scm_{to,from}_{utf8,utf32,latin1}_symbol{n,}
+    
+These new procedures convert to and from string representations in
+particular encodings.
+
+Basically, continue to use locale encoding for user input, user output,
+or interacting with the C library.  Use latin1 for ASCII, and for
+literals in source code.  Use utf8 for interaction with modern libraries
+which deal in UTF-8.  Use utf32 for interaction with utf32-using
+libraries.  Otherwise use scm_to_stringn or scm_from_stringn with a
+specific encoding.
+
+Also, scm_from_latin1_symbol is quite a bit faster now.
+
+** Documentation updates
+
+The GOOPS manual saw a lot of work, as well as documentation for the
+`(web ...)' modules.
+
+** Guile uses iconv directly for reading from and writing to ports.
+
+In addition to providing faster Unicode I/O (e.g., `display',
+`read-char'), this change improves error reporting.
+
+For instance, the `encoding-error' exception conveys information about
+the port and character that could not be encoded.  Likewise, the new
+`decoding-error' exception conveys information about the port from which
+data failed to be decoded, and leaves the port in a known position.
+
+** Source files default to UTF-8.
+
+If source files do not specify their encoding via a `coding:' block,
+the default encoding is UTF-8, instead of being taken from the current
+locale.
+
+** Man page updates
+
+Thanks to Mark Harig for many suggestions regarding the manual page,
+which is getting better.
+
+** Interactive Guile installs the current locale.
+    
+Instead of leaving the user in the "C" locale, running the Guile REPL
+installs the current locale.  [FIXME xref?]
+
+** `recv!', `recvfrom!', `send', `sendto' now deal in bytevectors
+
+These socket procedures now take bytevectors as arguments, instead of
+strings.  There is some deprecated string support, however.
+
+** New foreign API: `define-wrapped-pointer-type', `pointer?'
+    
+See "Foreign Types", for more.
+
 ** Changes and bugfixes in numerics code
 
+*** Added two new sets of fast quotient and remainder operators
+
+Added two new sets of fast quotient and remainder operator pairs with
+different semantics than the R5RS operators.  They support not only
+integers, but all reals, including exact rationals and inexact
+floating point numbers.
+
+These procedures accept two real numbers N and D, where the divisor D
+must be non-zero.  `euclidean-quotient' returns the integer Q and
+`euclidean-remainder' returns the real R such that N = Q*D + R and
+0 <= R < |D|.  `euclidean/' returns both Q and R, and is more
+efficient than computing each separately.  Note that when D > 0,
+`euclidean-quotient' returns floor(N/D), and when D < 0 it returns
+ceiling(N/D).
+
+`centered-quotient', `centered-remainder', and `centered/' are similar
+except that the range of remainders is -abs(D/2) <= R < abs(D/2), and
+`centered-quotient' rounds N/D to the nearest integer.
+
+Note that these operators are equivalent to the R6RS integer division
+operators `div', `mod', `div-and-mod', `div0', `mod0', and
+`div0-and-mod0'.
+
+*** Complex number changes
+
+Guile is now able to represent non-real complex numbers whose
+imaginary part is an _inexact_ zero (0.0 or -0.0), per R6RS.
+Previously, such numbers were immediately changed into inexact reals.
+
+(real? 0.0+0.0i) now returns #f, per R6RS, although (zero? 0.0+0.0i)
+still returns #t, per R6RS.  (= 0 0.0+0.0i) and (= 0.0 0.0+0.0i) are
+#t, but the same comparisons using `eqv?' or `equal?' are #f.
+
+Like other non-real numbers, these complex numbers with inexact zero
+imaginary part will raise exceptions is passed to procedures requiring
+reals, such as `<', `>', `<=', `>=', `min', `max', `positive?',
+`negative?', `inf?', `nan?', `finite?', etc.
+
+**** `make-rectangular' changes
+
+scm_make_rectangular `make-rectangular' now returns a real number only
+if the imaginary part is an _exact_ 0.  Previously, it would return a
+real number if the imaginary part was an inexact zero.
+
+scm_c_make_rectangular now always returns a non-real complex number,
+even if the imaginary part is zero.  Previously, it would return a
+real number if the imaginary part was zero.
+
+**** `make-polar' changes
+
+scm_make_polar `make-polar' now returns a real number only if the
+angle or magnitude is an _exact_ 0.  If the magnitude is an exact 0,
+it now returns an exact 0.  Previously, it would return a real
+number if the imaginary part was an inexact zero.
+
+scm_c_make_polar now always returns a non-real complex number, even if
+the imaginary part is 0.0.  Previously, it would return a real number
+if the imaginary part was 0.0.
+
+**** `imag-part' changes
+
+scm_imag_part `imag-part' now returns an exact 0 if applied to an
+inexact real number.  Previously it returned an inexact zero in this
+case.
+
 *** `eqv?' and `equal?' now compare numbers equivalently
 
 scm_equal_p `equal?' now behaves equivalently to scm_eqv_p `eqv?' for
@@ -27,10 +244,15 @@ Previously, `(equal? +nan.0 +nan.0)' returned #f, although
 both returned #t.  R5RS requires that `equal?' behave like
 `eqv?' when comparing numbers.
 
-*** Infinities are no longer integers.
+*** Change in handling products `*' involving exact 0
 
-Following the R6RS, infinities (+inf.0 and -inf.0) are no longer
-considered to be integers.
+scm_product `*' now handles exact 0 differently.  A product containing
+an exact 0 now returns an exact 0 if and only if the other arguments
+are all exact.  An inexact zero is returned if and only if the other
+arguments are all finite but not all exact.  If an infinite or NaN
+value is present, a NaN value is returned.  Previously, any product
+containing an exact 0 yielded an exact 0, regardless of the other
+arguments.
 
 *** `expt' and `integer-expt' changes when the base is 0
 
@@ -40,6 +262,30 @@ integer-expt.  This is more correct, and conforming to R6RS, but seems
 to be incompatible with R5RS, which would return 0 for all non-zero
 values of N.
 
+*** `expt' and `integer-expt' are more generic, less strict
+
+When raising to an exact non-negative integer exponent, `expt' and
+`integer-expt' are now able to exponentiate any object that can be
+multiplied using `*'.  They can also raise an object to an exact
+negative integer power if its reciprocal can be taken using `/'.
+In order to allow this, the type of the first argument is no longer
+checked when raising to an exact integer power.  If the exponent is 0
+or 1, the first parameter is not manipulated at all, and need not
+even support multiplication.
+
+*** Infinities are no longer integers, nor rationals
+
+scm_integer_p `integer?' and scm_rational_p `rational?' now return #f
+for infinities, per R6RS.  Previously they returned #t for real
+infinities.  The real infinities and NaNs are still considered real by
+scm_real `real?' however, per R6RS.
+
+*** NaNs are no longer rationals
+
+scm_rational_p `rational?' now returns #f for NaN values, per R6RS.
+Previously it returned #t for real NaN values.  They are still
+considered real by scm_real `real?' however, per R6RS.
+
 *** `inf?' and `nan?' now throw exceptions for non-reals
 
 The domain of `inf?' and `nan?' is the real numbers.  Guile now signals
@@ -47,6 +293,21 @@ an error when a non-real number or non-number is passed to these
 procedures.  (Note that NaNs _are_ considered numbers by scheme, despite
 their name).
 
+*** `rationalize' bugfixes and changes
+
+Fixed bugs in scm_rationalize `rationalize'.  Previously, it returned
+exact integers unmodified, although that was incorrect if the epsilon
+was at least 1 or inexact, e.g. (rationalize 4 1) should return 3 per
+R5RS and R6RS, but previously it returned 4.  It also now handles
+cases involving infinities and NaNs properly, per R6RS.
+
+*** Trigonometric functions now return exact numbers in some cases
+
+scm_sin `sin', scm_cos `cos', scm_tan `tan', scm_asin `asin', scm_acos
+`acos', scm_atan `atan', scm_sinh `sinh', scm_cosh `cosh', scm_tanh
+`tanh', scm_sys_asinh `asinh', scm_sys_acosh `acosh', and
+scm_sys_atanh `atanh' now return exact results in some cases.
+
 *** New procedure: `finite?'
 
 Add scm_finite_p `finite?' from R6RS to guile core, which returns #t
@@ -56,17 +317,25 @@ NaNs are neither finite nor infinite.
 
 *** R6RS base library changes
 
+**** `div', `mod', `div-and-mod', `div0', `mod0', `div0-and-mod0'
+
+Efficient versions of these R6RS division operators are now supported.
+See the NEWS entry entitled `Added two new sets of fast quotient and
+remainder operators' for more information.
+
 **** `infinite?' changes
 
-`infinite?' now returns #t for non-real complex infinities, and throws
-exceptions for non-numbers.  (Note that NaNs _are_ considered numbers
-by scheme, despite their name).
+`infinite?' and `finite?' now throw exceptions for non-numbers.  (Note
+that NaNs _are_ considered numbers by scheme, despite their name).
+
+**** `real-valued?', `rational-valued?' and `integer-valued?' changes
+
+These predicates are now implemented in accordance with R6RS.
 
-**** `finite?' changes
+** R6RS textual I/O procedures raise R6RS error conditions
 
-`finite?' now returns #f for NaNs and non-real complex infinities, and
-throws exceptions for non-numbers.  (Note that NaNs _are_ considered
-numbers by scheme, despite their name).
+R6RS procedures `get-char', `put-string', etc. now raise the correct
+R6RS error coding, i.e., `&i/o-decoding-error' or `&i/o-encoding-error'.
 
 ** New reader option: `hungry-eol-escapes'
 
@@ -340,12 +609,12 @@ newer than that of the .scm file; if the .scm or .go files are moved
 after installation, care should be taken to preserve their original
 timestamps.
 
-Autocompiled files will be stored in the $XDG_CACHE_HOME/guile/ccache
+Auto-compiled files will be stored in the $XDG_CACHE_HOME/guile/ccache
 directory, where $XDG_CACHE_HOME defaults to ~/.cache. This directory
 will be created if needed.
 
-To inhibit autocompilation, set the GUILE_AUTO_COMPILE environment
-variable to 0, or pass --no-autocompile on the Guile command line.
+To inhibit automatic compilation, set the GUILE_AUTO_COMPILE environment
+variable to 0, or pass --no-auto-compile on the Guile command line.
 
 ** New POSIX procedures: `getrlimit' and `setrlimit'