*** empty log message ***
[bpt/guile.git] / NEWS
diff --git a/NEWS b/NEWS
index c1d780b..56ac01d 100644 (file)
--- a/NEWS
+++ b/NEWS
-Guile NEWS --- history of user-visible changes.  2 Aug 1996  -*- text -*-
-Copyright (C) 1996 Free Software Foundation, Inc.
+Guile NEWS --- history of user-visible changes.  -*- text -*-
+Copyright (C) 1996, 1997 Free Software Foundation, Inc.
 See the end for copying conditions.
 
 Please send Guile bug reports to bug-guile@prep.ai.mit.edu.
 \f
-Guile 1.0b3
+Changes in Guile 1.1 (Sun 5 Jan 1997):
+
+* Changes to the distribution.
+
+The Guile 1.0 distribution has been split up into several smaller
+pieces:
+guile-core --- the Guile interpreter itself.
+guile-tcltk --- the interface between the Guile interpreter and
+       Tcl/Tk; Tcl is an interpreter for a stringy language, and Tk
+       is a toolkit for building graphical user interfaces.
+guile-rgx-ctax --- the interface between Guile and the Rx regular
+       expression matcher, and the translator for the Ctax
+       programming language.  These are packaged together because the
+       Ctax translator uses Rx to parse Ctax source code.
+
+We no longer distribute the documentation, since it was either out of
+date, or incomplete.  As soon as we have current documentation, we
+will distribute it.
+
+* Changes to the stand-alone interpreter
+
+** guile now accepts command-line arguments compatible with SCSH, Olin
+Shivers' Scheme Shell.
+
+In general, arguments are evaluated from left to right, but there are
+exceptions.  The following switches stop argument processing, and
+stash all remaining command-line arguments as the value returned by
+the (command-line) function.
+  -s SCRIPT      load Scheme source code from FILE, and exit
+  -c EXPR        evalute Scheme expression EXPR, and exit
+  --             stop scanning arguments; run interactively
+
+The switches below are processed as they are encountered.
+  -l FILE        load Scheme source code from FILE
+  -e FUNCTION    after reading script, apply FUNCTION to
+                 command line arguments
+  -ds            do -s script at this point
+  --emacs        enable Emacs protocol (experimental)
+  -h, --help     display this help and exit
+  -v, --version  display version information and exit
+  \              read arguments from following script lines
+
+So, for example, here is a Guile script named `ekko' (thanks, Olin)
+which re-implements the traditional "echo" command:
 
-User-visible changes since Thursday, September 5:
+#!/usr/local/bin/guile -s
+!#
+(define (main args)
+       (map (lambda (arg) (display arg) (display " "))
+            (cdr args))
+       (newline))
+
+(main (command-line))
 
+Suppose we invoke this script as follows:
 
-* Guile now distinguishes between #f and the empty list.
+       ekko a speckled gecko
 
-This is for compatibility with the IEEE standard, the (possibly)
-upcoming Revised^5 Report on Scheme, and many extant Scheme
-implementations.
+Through the magic of Unix script processing (triggered by the `#!'
+token at the top of the file), /usr/local/bin/guile receives the
+following list of command-line arguments:
 
-Guile used to have #f and '() denote the same object, to make Scheme's
-type system more compatible with Emacs Lisp's.  However, the change
-caused too much trouble for Scheme programmers, and we found another
-way to reconcile Emacs Lisp with Scheme that didn't require this.
+       ("-s" "./ekko" "a" "speckled" "gecko")
+
+Unix inserts the name of the script after the argument specified on
+the first line of the file (in this case, "-s"), and then follows that
+with the arguments given to the script.  Guile loads the script, which
+defines the `main' function, and then applies it to the list of
+remaining command-line arguments, ("a" "speckled" "gecko").
+
+* Changes to the procedure for linking libguile with your programs
+
+** Guile now builds and installs a shared guile library, if your
+system support shared libraries.  (It still builds a static library on
+all systems.)  Guile automatically detects whether your system
+supports shared libraries.  To prevent Guile from buildisg shared
+libraries, pass the `--disable-shared' flag to the configure script.
+
+Guile takes longer to compile when it builds shared libraries, because
+it must compile every file twice --- once to produce position-
+independent object code, and once to produce normal object code.
+
+** The libthreads library has been merged into libguile.
+
+To link a program against Guile, you now need only link against
+-lguile and -lqt; -lthreads is no longer needed.  If you are using
+autoconf to generate configuration scripts for your application, the
+following lines should suffice to add the appropriate libraries to
+your link command:
+
+### Find quickthreads and libguile.
+AC_CHECK_LIB(qt, main)
+AC_CHECK_LIB(guile, scm_shell)
+
+* Changes to Scheme functions
+
+** There are new accessors and setters for the broken-out time vectors
+returned by `localtime', `gmtime', and that ilk.  They are:
+
+  Component                 Accessor     Setter
+  ========================= ============ ============
+  seconds                   tm:sec       set-tm:sec
+  minutes                   tm:min       set-tm:min
+  hours                     tm:hour      set-tm:hour
+  day of the month          tm:mday      set-tm:mday
+  month                     tm:mon       set-tm:mon
+  year                      tm:year      set-tm:year
+  day of the week           tm:wday      set-tm:wday
+  day in the year           tm:yday      set-tm:yday
+  daylight saving time      tm:isdst     set-tm:isdst
+  GMT offset, seconds       tm:gmtoff    set-tm:gmtoff
+  name of time zone         tm:zone      set-tm:zone
+
+** There are new accessors for the vectors returned by `uname'.
+
+  Component                                      Accessor
+  ============================================== ================
+  name of the operating system implementation    utsname:sysname
+  network name of this machine                   utsname:nodename
+  release level of the operating system          utsname:release
+  version level of the operating system          utsname:version
+  machine hardware platform                      utsname:machine
+
+** There is now a complete set of accessors for the vectors returned
+by the `getserv'
+
+** The new function `eval-string' reads Scheme expressions from a
+string and evaluates them, returning the value of the last expression
+in the string.  If the string contains no expressions, it returns an
+unspecified value.
+
+** The new function `command-line' returns the command-line arguments
+given to Guile, as a list of strings.
+
+When using guile as a script interpreter, `command-line' returns the
+script's arguments; those processed by the interpreter (like `-s' or
+`-c') are omitted.  (In other words, you get the normal, expected
+behavior.)  Any application that uses scm_shell to process its
+command-line arguments gets this behavior as well.
+
+** The new function `load-user-init' looks for a file called `.guile'
+in the user's home directory, and loads it if it exists.  This is
+mostly for use by the code generated by scm_compile_shell_switches,
+but we thought it might also be useful in other circumstances.
+
+** The new function `log10' returns the base-10 logarithm of its
+argument.
+
+** gethost, getproto, and getnet, and getserv now return more helpful
+error codes.
 
+* Changes to the gh_ interface
 
-* You can now use Guile as a shell script interpreter.
+** gh_eval_str() now returns an SCM object which is the result of the
+evaluation
+
+** gh_scm2str() now copies the Scheme data to a caller-provided C
+array
+
+** gh_scm2newstr() now makes a C array, copies the Scheme data to it,
+and returns the array
+
+** gh_scm2str0() is gone: there is no need to distinguish
+null-terminated from non-null-terminated, since gh_scm2newstr() allows
+the user to interpret the data both ways.
+
+* Changes to the scm_ interface
+
+** The new function scm_shell makes it easy for user applications to
+process command-line arguments in a way that is compatible with the
+stand-alone guile interpreter (which is in turn compatible with SCSH,
+the Scheme shell).
+
+To use the scm_shell function, first initialize any guile modules
+linked into your application, and then call scm_shell with the values
+of ARGC and ARGV your `main' function received.  scm_shell will adding
+any SCSH-style meta-arguments from the top of the script file to the
+argument vector, and then process the command-line arguments.  This
+generally means loading a script file or starting up an interactive
+command interpreter.  For details, see "Changes to the stand-alone
+interpreter" above.
+
+** [[new: scm_usage_name, scm_shell_usage, scm_compile_shell_switches]]
+
+** scm_eval_0str now returns SCM_UNSPECIFIED if the string contains no
+expressions.  It used to return SCM_EOL.
+
+* Changes to documentation
+
+** the $(srcdir)/newdoc hierarchy now contains a new approach to the
+manuals.  The approach, recommended by Jim Blandy, is to have: (*) a
+tutorial with the pedagogical style of guile-user, and a non-dry
+reference manual in the style of the most excellent GNU libc reference
+manual: the reference manual should be complete, but at the same time
+it should have an introductory screen for each major topic, which can
+be referenced if the user goes "up" a level in the info documentation.
+
+\f
+Guile 1.0b3
+
+User-visible changes from Thursday, September 5, 1996 until Guile 1.0
+(Sun 5 Jan 1997):
+
+* Changes to the 'guile' program:
+
+** Guile now loads some new files when it starts up.  Guile first
+searches the load path for init.scm, and loads it if found.  Then, if
+Guile is not being used to execute a script, and the user's home
+directory contains a file named `.guile', Guile loads that.
+
+** You can now use Guile as a shell script interpreter.
 
 To paraphrase the SCSH manual:
 
@@ -80,7 +273,7 @@ exec /really/long/path/to/guile -s "$0" ${1+"$@"}
 Note that some very old Unix systems don't support the `#!' syntax.
 
 
-* You can now run Guile without installing it.
+** You can now run Guile without installing it.
 
 Previous versions of the interactive Guile interpreter (`guile')
 couldn't start up unless Guile's Scheme library had been installed;
@@ -99,7 +292,167 @@ you might say
        export SCHEME_LOAD_PATH=/home/jimb/my-scheme:/home/jimb/guile-1.0b3
 
 
-* Guile's header files should no longer conflict with your system's
+** Guile's read-eval-print loop no longer prints #<unspecified>
+results.  If the user wants to see this, she can evaluate the
+expression (assert-repl-print-unspecified #t), perhaps in her startup
+file.
+
+** Guile no longer shows backtraces by default when an error occurs;
+however, it does display a message saying how to get one, and how to
+request that they be displayed by default.  After an error, evaluate
+   (backtrace)
+to see a backtrace, and
+   (debug-enable 'backtrace)
+to see them by default.
+
+
+
+* Changes to Guile Scheme:
+
+** Guile now distinguishes between #f and the empty list.
+
+This is for compatibility with the IEEE standard, the (possibly)
+upcoming Revised^5 Report on Scheme, and many extant Scheme
+implementations.
+
+Guile used to have #f and '() denote the same object, to make Scheme's
+type system more compatible with Emacs Lisp's.  However, the change
+caused too much trouble for Scheme programmers, and we found another
+way to reconcile Emacs Lisp with Scheme that didn't require this.
+
+
+** Guile's delq, delv, delete functions, and their destructive
+counterparts, delq!, delv!, and delete!, now remove all matching
+elements from the list, not just the first.  This matches the behavior
+of the corresponding Emacs Lisp functions, and (I believe) the Maclisp
+functions which inspired them.
+
+I recognize that this change may break code in subtle ways, but it
+seems best to make the change before the FSF's first Guile release,
+rather than after.
+
+
+** The compiled-library-path function has been deleted from libguile.
+
+** The facilities for loading Scheme source files have changed.
+
+*** The variable %load-path now tells Guile which directories to search
+for Scheme code.  Its value is a list of strings, each of which names
+a directory.
+
+*** The variable %load-extensions now tells Guile which extensions to
+try appending to a filename when searching the load path.  Its value
+is a list of strings.  Its default value is ("" ".scm").
+
+*** (%search-load-path FILENAME) searches the directories listed in the
+value of the %load-path variable for a Scheme file named FILENAME,
+with all the extensions listed in %load-extensions.  If it finds a
+match, then it returns its full filename.  If FILENAME is absolute, it
+returns it unchanged.  Otherwise, it returns #f.
+
+%search-load-path will not return matches that refer to directories.
+
+*** (primitive-load FILENAME :optional CASE-INSENSITIVE-P SHARP)
+uses %seach-load-path to find a file named FILENAME, and loads it if
+it finds it.  If it can't read FILENAME for any reason, it throws an
+error.
+
+The arguments CASE-INSENSITIVE-P and SHARP are interpreted as by the
+`read' function.
+
+*** load uses the same searching semantics as primitive-load.
+
+*** The functions %try-load, try-load-with-path, %load, load-with-path,
+basic-try-load-with-path, basic-load-with-path, try-load-module-with-
+path, and load-module-with-path have been deleted.  The functions
+above should serve their purposes.
+
+*** If the value of the variable %load-hook is a procedure,
+`primitive-load' applies its value to the name of the file being
+loaded (without the load path directory name prepended).  If its value
+is #f, it is ignored.  Otherwise, an error occurs.
+
+This is mostly useful for printing load notification messages.
+
+
+** The function `eval!' is no longer accessible from the scheme level.
+We can't allow operations which introduce glocs into the scheme level,
+because Guile's type system can't handle these as data.  Use `eval' or
+`read-and-eval!' (see below) as replacement.
+
+** The new function read-and-eval! reads an expression from PORT,
+evaluates it, and returns the result.  This is more efficient than
+simply calling `read' and `eval', since it is not necessary to make a
+copy of the expression for the evaluator to munge.
+
+Its optional arguments CASE_INSENSITIVE_P and SHARP are interpreted as
+for the `read' function.
+
+
+** The function `int?' has been removed; its definition was identical
+to that of `integer?'.
+
+** The functions `<?', `<?', `<=?', `=?', `>?', and `>=?'.  Code should
+use the R4RS names for these functions.
+
+** The function object-properties no longer returns the hash handle;
+it simply returns the object's property list.
+
+** Many functions have been changed to throw errors, instead of
+returning #f on failure.  The point of providing exception handling in
+the language is to simplify the logic of user code, but this is less
+useful if Guile's primitives don't throw exceptions.
+
+** The function `fileno' has been renamed from `%fileno'.
+
+** The function primitive-mode->fdes returns #t or #f now, not 1 or 0.
+
+
+* Changes to Guile's C interface:
+
+** The library's initialization procedure has been simplified.
+scm_boot_guile now has the prototype:
+
+void scm_boot_guile (int ARGC,
+                     char **ARGV,
+                    void (*main_func) (),
+                    void *closure);
+
+scm_boot_guile calls MAIN_FUNC, passing it CLOSURE, ARGC, and ARGV.
+MAIN_FUNC should do all the work of the program (initializing other
+packages, reading user input, etc.) before returning.  When MAIN_FUNC
+returns, call exit (0); this function never returns.  If you want some
+other exit value, MAIN_FUNC may call exit itself.
+
+scm_boot_guile arranges for program-arguments to return the strings
+given by ARGC and ARGV.  If MAIN_FUNC modifies ARGC/ARGV, should call
+scm_set_program_arguments with the final list, so Scheme code will
+know which arguments have been processed.
+
+scm_boot_guile establishes a catch-all catch handler which prints an
+error message and exits the process.  This means that Guile exits in a
+coherent way when system errors occur and the user isn't prepared to
+handle it.  If the user doesn't like this behavior, they can establish
+their own universal catcher in MAIN_FUNC to shadow this one.
+
+Why must the caller do all the real work from MAIN_FUNC?  The garbage
+collector assumes that all local variables of type SCM will be above
+scm_boot_guile's stack frame on the stack.  If you try to manipulate
+SCM values after this function returns, it's the luck of the draw
+whether the GC will be able to find the objects you allocate.  So,
+scm_boot_guile function exits, rather than returning, to discourage
+people from making that mistake.
+
+The IN, OUT, and ERR arguments were removed; there are other
+convenient ways to override these when desired.
+
+The RESULT argument was deleted; this function should never return.
+
+The BOOT_CMD argument was deleted; the MAIN_FUNC argument is more
+general.
+
+
+** Guile's header files should no longer conflict with your system's
 header files.
 
 In order to compile code which #included <libguile.h>, previous
@@ -113,39 +466,37 @@ refer to all Guile's other header files as <libguile/mumble.h>.
 Guile's installation procedure puts libguile.h in $(includedir), and
 the rest in $(includedir)/libguile.
 
-* Guile's delq, delv, delete functions, and their destructive
-counterparts, delq!, delv!, and delete!, now remove all matching
-elements from the list, not just the first.  This matches the behavior
-of the corresponding Emacs Lisp functions, and (I believe) the Maclisp
-functions which inspired them.
 
-I recognize that this change may break code in subtle ways, but it
-seems best to make the change before the FSF's first Guile release,
-rather than after.
+** Two new C functions, scm_protect_object and scm_unprotect_object,
+have been added to the Guile library.
 
+scm_protect_object (OBJ) protects OBJ from the garbage collector.
+OBJ will not be freed, even if all other references are dropped,
+until someone does scm_unprotect_object (OBJ).  Both functions
+return OBJ.
 
-* The compiled-library-path function has been deleted from libguile.
+Note that calls to scm_protect_object do not nest.  You can call
+scm_protect_object any number of times on a given object, and the
+next call to scm_unprotect_object will unprotect it completely.
 
+Basically, scm_protect_object and scm_unprotect_object just
+maintain a list of references to things.  Since the GC knows about
+this list, all objects it mentions stay alive.  scm_protect_object
+adds its argument to the list; scm_unprotect_object remove its
+argument from the list.
 
-* A variable and two new functions have been added to libguile:
 
-** The variable %load-path now tells Guile which directories to search
-for Scheme code.  Its value is a list of strings, each of which names
-a directory.
+** scm_eval_0str now returns the value of the last expression
+evaluated.
 
-** (%search-load-path FILENAME) searches the directories listed in the
-value of the %load-path variable for a Scheme file named FILENAME.  If
-it finds a match, then it returns its full filename.  Otherwise, it
-returns #f.  %search-load-path will not return matches that refer to
-directories.
+** The new function scm_read_0str reads an s-expression from a
+null-terminated string, and returns it.
 
-** (%try-load-path FILENAME :optional CASE-INSENSITIVE-P SHARP)
-searches the directories listed in %load-path for a file named
-FILENAME, and loads it if it finds it.  If it can't read FILENAME for
-any reason, it throws an error.
+** The new function `scm_stdio_to_port' converts a STDIO file pointer
+to a Scheme port object.
 
-The arguments CASE-INSENSITIVE-P and SHARP are interpreted as by the
-%try-load function.
+** The new function `scm_set_program_arguments' allows C code to set
+the value teruturned by the Scheme `program-arguments' function.
 
 \f
 Older changes:
@@ -176,7 +527,7 @@ Until then, gtcltk-lib provides trivial, low-maintenance functionality.
 \f
 Copyright information:
 
-Copyright (C) 1996 Free Software Foundation, Inc.
+Copyright (C) 1996,1997 Free Software Foundation, Inc.
 
    Permission is granted to anyone to make or distribute verbatim copies
    of this document as received, in any medium, provided that the
@@ -188,3 +539,9 @@ Copyright (C) 1996 Free Software Foundation, Inc.
    under the above conditions, provided also that they
    carry prominent notices stating who last changed them.
 
+\f
+Local variables:
+mode: outline
+paragraph-separate: "[         \f]*$"
+end:
+