* init.c (scm_boot_guile_1): Added calls to debug-malloc init
[bpt/guile.git] / NEWS
diff --git a/NEWS b/NEWS
index a007376..a1f7d10 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,9 +1,379 @@
 Guile NEWS --- history of user-visible changes.  -*- text -*-
-Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
 See the end for copying conditions.
 
 Please send Guile bug reports to bug-guile@gnu.org.
 \f
+Changes since Guile 1.3.4:
+
+* Changes to the distribution
+
+** Trees from nightly snapshots and CVS now require you to run autogen.sh.
+
+We've changed the way we handle generated files in the Guile source
+repository.  As a result, the procedure for building trees obtained
+from the nightly FTP snapshots or via CVS has changed:
+- You must have appropriate versions of autoconf, automake, and
+  libtool installed on your system.  See README for info on how to
+  obtain these programs.
+- Before configuring the tree, you must first run the script
+  `autogen.sh' at the top of the source tree.
+
+The Guile repository used to contain not only source files, written by
+humans, but also some generated files, like configure scripts and
+Makefile.in files.  Even though the contents of these files could be
+derived mechanically from other files present, we thought it would
+make the tree easier to build if we checked them into CVS.
+
+However, this approach means that minor differences between
+developer's installed tools and habits affected the whole team.
+So we have removed the generated files from the repository, and
+added the autogen.sh script, which will reconstruct them
+appropriately.
+
+
+** configure now has experimental options to remove support for certain
+features:
+
+--disable-arrays     omit array and uniform array support
+--disable-posix      omit posix interfaces
+--disable-networking omit networking interfaces
+--disable-regex      omit regular expression interfaces
+
+These are likely to become separate modules some day.
+
+** Added new configure option --enable-debug-freelist
+
+This enables a debugging version of SCM_NEWCELL(), and also registers
+an extra primitive, the setter `gc-set-debug-check-freelist!'.
+
+Configure with the --enable-debug-freelist option to enable
+the gc-set-debug-check-freelist! primitive, and then use:
+
+(gc-set-debug-check-freelist! #t)  # turn on checking of the freelist
+(gc-set-debug-check-freelist! #f)  # turn off checking
+
+Checking of the freelist forces a traversal of the freelist and
+a garbage collection before each allocation of a cell.  This can
+slow down the interpreter dramatically, so the setter should be used to
+turn on this extra processing only when necessary.
+
+* Changes to the stand-alone interpreter
+
+** Dynamic linking now uses libltdl from the libtool package.
+
+The old system dependent code for doing dynamic linking has been
+replaced with calls to the libltdl functions which do all the hairy
+details for us.
+
+The major improvement is that you can now directly pass libtool
+library names like "libfoo.la" to `dynamic-link' and `dynamic-link'
+will be able to do the best shared library job you can get, via
+libltdl.
+
+The way dynamic libraries are found has changed and is not really
+portable across platforms, probably.  It is therefore recommended to
+use absolute filenames when possible.
+
+If you pass a filename without an extension to `dynamic-link', it will
+try a few appropriate ones.  Thus, the most platform ignorant way is
+to specify a name like "libfoo", without any directories and
+extensions.
+
+** Guile COOP threads are now compatible with LinuxThreads
+
+Previously, COOP threading wasn't possible in applications linked with
+Linux POSIX threads due to their use of the stack pointer to find the
+thread context.  This has now been fixed with a workaround which uses
+the pthreads to allocate the stack.
+
+** New primitives: `pkgdata-dir', `site-dir', `library-dir' 
+
+** Positions of erring expression in scripts
+
+With version 1.3.4, the location of the erring expression in Guile
+scipts is no longer automatically reported.  (This should have been
+documented before the 1.3.4 release.)
+
+You can get this information by enabling recording of positions of
+source expressions and running the debugging evaluator.  Put this at
+the top of your script (or in your "site" file):
+
+  (read-enable 'positions)
+  (debug-enable 'debug)
+
+** Backtraces in scripts
+
+It is now possible to get backtraces in scripts.
+
+Put
+
+  (debug-enable 'debug 'backtrace)
+
+at the top of the script.
+
+(The first options enables the debugging evaluator.
+ The second enables backtraces.)
+
+** Attempting to get the value of an unbound variable now produces
+an exception with a key of 'unbound-variable instead of 'misc-error.
+
+** The initial default output port is now unbuffered if it's using a
+tty device.  Previously in this situation it was line-buffered.
+
+* Changes to Scheme functions and syntax
+
+** close-input-port and close-output-port are now R5RS
+
+These procedures have been turned into primitives and have R5RS behaviour.
+
+** New procedure: simple-format PORT MESSAGE ARG1 ...
+
+(ice-9 boot) makes `format' an alias for `simple-format' until possibly
+extended by the more sophisticated version in (ice-9 format)
+
+(simple-format port message . args)
+Write MESSAGE to DESTINATION, defaulting to `current-output-port'.
+MESSAGE can contain ~A (was %s) and ~S (was %S) escapes.  When printed,
+the escapes are replaced with corresponding members of ARGS:
+~A formats using `display' and ~S formats using `write'.
+If DESTINATION is #t, then use the `current-output-port',
+if DESTINATION is #f, then return a string containing the formatted text.
+Does not add a trailing newline."
+
+** string-ref: the second argument is no longer optional.
+
+** string, list->string: no longer accept strings in their arguments,
+only characters, for compatibility with R5RS.
+
+** New procedure: port-closed? PORT
+Returns #t if PORT is closed or #f if it is open.
+
+* Changes to the scm_ interface
+
+** Guile primitives now carry docstrings!
+
+Thanks to Greg Badros!
+
+** Guile primitives are defined in a new way: GUILE_PROC/GUILE_PROC1
+
+Now Guile primitives are defined using the GUILE_PROC/GUILE_PROC1 macros
+and must contain a docstring that is extracted into foo.doc using a new
+guile-doc-snarf script (that uses guile-doc-snarf.awk).
+
+** Guile primitives use a new technique for validation of arguments
+
+SCM_VALIDATE_* macros are defined to ease the redundancy and improve
+the readability of argument checking.
+
+** All (nearly?) K&R prototypes for functions replaced with ANSI C equivalents.
+
+** New macros: SCM_PACK, SCM_UNPACK, SCM_UNPACK_CAR
+
+Compose/decompose an SCM value.
+
+The SCM type is now defined as void * on most architectures.  This
+makes it easier to find several types of bugs, for example when SCM
+values are treated as integers without conversion.  Values of the SCM
+type should be treated as "atomic" values.  These macros are used when
+composing/decomposing an SCM value, either because you want to access
+individual bits, or because you want to treat it as an integer value.
+
+E.g., in order to set bit 7 in an SCM value x, use the expression
+
+  SCM_PACK (SCM_UNPACK (x) | 0x80)
+
+SCM_UNPACK_CAR (X) is defined as SCM_UNPACK (SCM_CAR (X))
+
+** Deprecated macros: SCM_INPORTP, SCM_OUTPORTP
+
+These macros will be removed in next release of Guile.
+
+** Port internals: the rw_random variable in the scm_port structure
+must be set to non-zero in any random access port.  In recent Guile
+releases it was only set for bidirectional random-access ports.
+
+** Port internals: the seek ptob procedure is now responsible for
+resetting the buffers if required.  The change was made so that in the
+special case of reading the current position (i.e., seek p 0 SEEK_CUR)
+the fport and strport ptobs can avoid resetting the buffers,
+in particular to avoid discarding unread chars.  An existing port
+type can be fixed by adding something like the following to the
+beginning of the ptob seek procedure:
+
+      if (pt->rw_active == SCM_PORT_READ)
+       scm_end_input (object);
+      else if (pt->rw_active == SCM_PORT_WRITE)
+       ptob->flush (object);
+
+although to actually avoid resetting the buffers and discard unread
+chars requires further hacking that depends on the characteristics
+of the ptob.
+
+** The scm_sysmissing procedure is no longer used in libguile.
+Unless it turns out to be unexpectedly useful to somebody, it will be
+removed in a future version.
+
+** The format of error message strings has changed
+
+The two C procedures: scm_display_error and scm_error, as well as the
+primitive `scm-error', now use scm_simple_format to do their work.
+This means that the message strings of all code must be updated to use
+~A where %s was used before, and ~S where %S was used before.
+
+During the period when there still are a lot of old Guiles out there,
+you might want to support both old and new versions of Guile.
+
+There are basically two methods to achieve this.  Both methods use
+autoconf.  Put
+
+  AC_CHECK_FUNCS(scm_simple_format)
+
+in your configure.in.
+
+Method 1: Use the string concatenation features of ANSI C's
+          preprocessor.
+
+In C:
+
+#ifdef HAVE_SCM_SIMPLE_FORMAT
+#define FMT_S "~S"
+#else
+#define FMT_S "%S"
+#endif
+
+Then represent each of your error messages using a preprocessor macro:
+
+#define E_SPIDER_ERROR "There's a spider in your " ## FMT_S ## "!!!"
+
+In Scheme:
+
+(define fmt-s (if (defined? 'simple-format) "~S" "%S"))
+(define make-message string-append)
+
+(define e-spider-error (make-message "There's a spider in your " fmt-s "!!!"))
+
+Method 2: Use the oldfmt function found in doc/oldfmt.c.
+
+In C:
+
+scm_misc_error ("picnic", scm_c_oldfmt0 ("There's a spider in your ~S!!!"),
+                ...);
+
+In Scheme:
+
+(scm-error 'misc-error "picnic" (oldfmt "There's a spider in your ~S!!!")
+           ...)
+
+
+** Deprecated: coop_mutex_init, coop_condition_variable_init
+
+Don't use the functions coop_mutex_init and
+coop_condition_variable_init.  They will change.
+
+Use scm_mutex_init and scm_cond_init instead.
+
+** New function: int scm_cond_timedwait (scm_cond_t *COND, scm_mutex_t *MUTEX, const struct timespec *ABSTIME)
+     `scm_cond_timedwait' atomically unlocks MUTEX and waits on
+     COND, as `scm_cond_wait' does, but it also bounds the duration
+     of the wait. If COND has not been signaled before time ABSTIME,
+     the mutex MUTEX is re-acquired and `scm_cond_timedwait'
+     returns the error code `ETIMEDOUT'.
+
+     The ABSTIME parameter specifies an absolute time, with the same
+     origin as `time' and `gettimeofday': an ABSTIME of 0 corresponds
+     to 00:00:00 GMT, January 1, 1970.
+
+** New function: scm_cond_broadcast (scm_cond_t *COND)
+     `scm_cond_broadcast' restarts all the threads that are waiting
+     on the condition variable COND. Nothing happens if no threads are
+     waiting on COND.
+
+** New function: scm_key_create (scm_key_t *KEY, void (*destr_function) (void *))
+     `scm_key_create' allocates a new TSD key. The key is stored in
+     the location pointed to by KEY. There is no limit on the number
+     of keys allocated at a given time. The value initially associated
+     with the returned key is `NULL' in all currently executing threads.
+
+     The DESTR_FUNCTION argument, if not `NULL', specifies a destructor
+     function associated with the key. When a thread terminates,
+     DESTR_FUNCTION is called on the value associated with the key in
+     that thread. The DESTR_FUNCTION is not called if a key is deleted
+     with `scm_key_delete' or a value is changed with
+     `scm_setspecific'.  The order in which destructor functions are
+     called at thread termination time is unspecified.
+
+     Destructors are not yet implemented.
+
+** New function: scm_setspecific (scm_key_t KEY, const void *POINTER)
+     `scm_setspecific' changes the value associated with KEY in the
+     calling thread, storing the given POINTER instead.
+
+** New function: scm_getspecific (scm_key_t KEY)
+     `scm_getspecific' returns the value currently associated with
+     KEY in the calling thread.
+
+** New function: scm_key_delete (scm_key_t KEY)
+     `scm_key_delete' deallocates a TSD key. It does not check
+     whether non-`NULL' values are associated with that key in the
+     currently executing threads, nor call the destructor function
+     associated with the key.
+
+* Changes to system call interfaces:
+
+** The "select" procedure now tests port buffers for the ability to
+provide input or accept output.  Previously only the underlying file
+descriptors were checked.
+
+** New variable PIPE_BUF: the maximum number of bytes that can be
+atomically written to a pipe.
+
+** If a facility is not available on the system when Guile is
+compiled, the corresponding primitive procedure will not be defined.
+Previously it would have been defined but would throw a system-error
+exception if called.  Exception handlers which catch this case may
+need minor modification: an error will be thrown with key
+'unbound-variable instead of 'system-error.  Alternatively it's
+now possible to use `defined?' to check whether the facility is
+available.
+
+** Procedures which depend on the timezone should now give the correct
+result on systems which cache the TZ environment variable, even if TZ 
+is changed without calling tzset.
+
+* Changes to the networking interfaces:
+
+** New functions: htons, ntohs, htonl, ntohl: for converting short and
+long integers between network and host format.  For now, it's not
+particularly convenient to do this kind of thing, but consider:
+
+(define write-network-long
+  (lambda (value port)
+    (let ((v (make-uniform-vector 1 1 0)))
+      (uniform-vector-set! v 0 (htonl value))
+      (uniform-vector-write v port))))
+
+(define read-network-long
+  (lambda (port)
+    (let ((v (make-uniform-vector 1 1 0)))
+      (uniform-vector-read! v port)
+      (ntohl (uniform-vector-ref v 0)))))
+
+** If inet-aton fails, it now throws an error with key 'misc-error
+instead of 'system-error, since errno is not relevant.
+
+** Certain gethostbyname/gethostbyaddr failures now throw errors with
+specific keys instead of 'system-error.  The latter is inappropriate
+since errno will not have been set.  The keys are:
+'host-not-found, 'try-again, 'no-recovery and 'no-data.
+
+** sethostent, setnetent, setprotoent, setservent: now take an
+optional argument STAYOPEN, which specifies whether the database
+remains open after a database entry is accessed randomly (e.g., using
+gethostbyname for the hosts database.)  The default is #f.  Previously
+#t was always used.
+
+\f
 Changes since Guile 1.3.2:
 
 * Changes to the stand-alone interpreter
@@ -67,6 +437,26 @@ to activate readline is now
 
 This should work at any time, including from the guile prompt.
 
+To avoid confusion about the terms of Guile's license, please only
+enable readline for your personal use; please don't make it the
+default for others.  Here is why we make this rather odd-sounding
+request:
+
+Guile is normally licensed under a weakened form of the GNU General
+Public License, which allows you to link code with Guile without
+placing that code under the GPL.  This exception is important to some
+people.
+
+However, since readline is distributed under the GNU General Public
+License, when you link Guile with readline, either statically or
+dynamically, you effectively change Guile's license to the strict GPL.
+Whenever you link any strictly GPL'd code into Guile, uses of Guile
+which are normally permitted become forbidden.  This is a rather
+non-obvious consequence of the licensing terms.
+
+So, to make sure things remain clear, please let people choose for
+themselves whether to link GPL'd libraries like readline with Guile.
+
 ** regexp-substitute/global has changed slightly, but incompatibly.
 
 If you include a function in the item list, the string of the match