* environments.c: Don't use '==' to compare SCM objects.
[bpt/guile.git] / NEWS
diff --git a/NEWS b/NEWS
index f1bbbde..60db8e2 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,270 @@ See the end for copying conditions.
 
 Please send Guile bug reports to bug-guile@gnu.org.
 \f
+Changes since Guile 1.4:
+
+* Changes to the distribution
+
+** New modules (oop goops) etc
+
+The new modules
+
+  (oop goops)
+  (oop goops describe)
+  (oop goops save)
+  (oop goops active-slot)
+  (oop goops composite-slot)
+
+plus some GOOPS utility modules have been added.
+
+* Changes to the stand-alone interpreter
+
+** GOOPS has been merged into Guile
+
+The Guile Object Oriented Programming System has been integrated into
+Guile.
+
+Type
+
+  (use-modules (oop goops))
+
+access GOOPS bindings.
+
+We're now ready to try some basic GOOPS functionality.
+
+Generic functions
+
+  (define-method (+ (x <string>) (y <string>))
+    (string-append x y))
+
+  (+ 1 2) --> 3
+  (+ "abc" "de") --> "abcde"
+
+User-defined types
+
+  (define-class <2D-vector> ()
+    (x #:init-value 0 #:accessor x-component #:init-keyword #:x)
+    (y #:init-value 0 #:accessor y-component #:init-keyword #:y))
+
+  (define-method write ((obj <2D-vector>) port)
+    (display (format #f "<~S, ~S>" (x-component obj) (y-component obj))
+            port))
+
+  (define v (make <2D-vector> #:x 3 #:y 4))
+  v --> <3, 4>
+
+  (define-method + ((x <2D-vector>) (y <2D-vector>))
+    (make <2D-vector>
+          #:x (+ (x-component x) (x-component y))
+          #:y (+ (y-component x) (y-component y))))
+
+  (+ v v) --> <6, 8>
+
+Asking for the type of an object
+
+  (class-of v) --> #<<class> <2D-vector> 40241ac0>
+  <2D-vector>  --> #<<class> <2D-vector> 40241ac0>
+  (class-of 1) --> #<<class> <integer> 401b2a98>
+  <integer>    --> #<<class> <integer> 401b2a98>
+
+  (is-a? v <2D-vector>) --> #t
+
+See further in the GOOPS tutorial available in the guile-doc
+distribution in info (goops.info) and texinfo formats.
+
+** It's now possible to create modules with controlled environments
+
+Example:
+
+(use-modules (ice-9 safe))
+(define m (make-safe-module))
+;;; m will now be a module containing only a safe subset of R5RS
+(eval-in-module '(+ 1 2) m) --> 3
+(eval-in-module 'load m) --> ERROR: Unbound variable: load
+
+* Changes to Scheme functions and syntax
+
+** New function `make-object-property'
+
+This function returns a new `procedure with setter' P that can be used
+to attach a property to objects.  When calling P as
+
+   (set! (P obj) val)
+
+where `obj' is any kind of object, it attaches `val' to `obj' in such
+a way that it can be retrieved by calling P as
+
+    (P obj)
+
+This function will replace procedure properties, symbol properties and
+source properties eventually.
+
+** Module (ice-9 optargs) now uses keywords instead of `#&'.
+
+Instead of #&optional, #&key, etc you should now use #:optional,
+#:key, etc.  Since #:optional is a keyword, you can write it as just
+:optional when (read-set! keywords 'prefix) is active.
+
+The old reader syntax `#&' is still supported, but deprecated.  It
+will be removed in the next release.
+
+** Backward incompatible change: eval EXP ENVIRONMENT-SPECIFIER
+
+`eval' is now R5RS, that is it takes two arguments.
+The second argument is an environment specifier, i.e. either
+
+  (scheme-report-environment 5)
+  (null-environment 5)
+  (interaction-environment)
+
+or
+
+  any module.
+
+** New define-module option: pure
+
+Tells the module system not to include any bindings from the root
+module.
+
+Example:
+
+(define-module (totally-empty-module)
+  :pure)
+
+** New define-module option: export NAME1 ...
+
+Export names NAME1 ...
+
+This option is required if you want to be able to export bindings from
+a module which doesn't import one of `define-public' or `export'.
+
+Example:
+
+(define-module (foo)
+  :pure
+  :use-module (ice-9 r5rs)
+  :export (bar))
+
+;;; Note that we're pure R5RS below this point!
+
+(define (bar)
+  ...)
+
+** Deprecated: scm_make_shared_substring
+
+Explicit shared substrings will disappear from Guile.
+
+Instead, "normal" strings will be implemented using sharing
+internally, combined with a copy-on-write strategy.
+
+** Deprecated: scm_read_only_string_p
+
+The concept of read-only strings will disappear in next release of
+Guile.
+
+** Deprecated: scm_sloppy_memq, scm_sloppy_memv, scm_sloppy_member
+
+Instead, use scm_memq, scm_memv, scm_member.
+
+* Changes to the gh_ interface
+
+* Changes to the scm_ interface
+
+** New function: scm_init_guile ()
+
+In contrast to scm_boot_guile, scm_init_guile will return normally
+after initializing Guile.  It is not available on all systems, tho.
+
+** New functions: scm_primitive_make_property
+                  scm_primitive_property_ref
+                  scm_primitive_property_set_x
+                  scm_primitive_property_del_x
+
+These functions implement a new way to deal with object properties.
+See libguile/properties.c for their documentation.
+
+** New function: scm_done_free (long size)
+
+This function is the inverse of scm_done_malloc.  Use it to report the
+amount of smob memory you free.  The previous method, which involved
+calling scm_done_malloc with negative argument, was somewhat
+unintuitive (and is still available, of course).
+
+** New global variable scm_gc_running_p introduced.
+
+Use this variable to find out if garbage collection is being executed.  Up to
+now applications have used scm_gc_heap_lock to test if garbage collection was
+running, which also works because of the fact that up to know only the garbage
+collector has set this variable.  But, this is an implementation detail that
+may change.  Further, scm_gc_heap_lock is not set throughout gc, thus the use
+of this variable is (and has been) not fully safe anyway.
+
+** New macros:  SCM_CONTINUATION_LENGTH, SCM_CCLO_LENGTH, SCM_STACK_LENGTH, 
+SCM_STRING_LENGTH, SCM_SYMBOL_LENGTH, SCM_UVECTOR_LENGTH,
+SCM_BITVECTOR_LENGTH, SCM_VECTOR_LENGTH.
+
+Use these instead of SCM_LENGTH.
+
+** New macros:  SCM_STRING_CHARS, SCM_SYMBOL_CHARS, SCM_CCLO_BASE, 
+SCM_VECTOR_BASE, SCM_UVECTOR_BASE, SCM_BITVECTOR_BASE, SCM_COMPLEX_MEM,
+SCM_ARRAY_MEM
+
+Use these instead of SCM_CHARS or SCM_VELTS.
+
+** New macro:  SCM_BITVECTOR_P
+
+** New macro:  SCM_STRING_COERCE_0TERMINATION_X
+
+Use instead of SCM_COERCE_SUBSTR.
+
+** Deprecated macros:  SCM_OUTOFRANGE, SCM_NALLOC, SCM_HUP_SIGNAL, 
+SCM_INT_SIGNAL, SCM_FPE_SIGNAL, SCM_BUS_SIGNAL, SCM_SEGV_SIGNAL, 
+SCM_ALRM_SIGNAL, SCM_GC_SIGNAL, SCM_TICK_SIGNAL, SCM_SIG_ORD, 
+SCM_ORD_SIG, SCM_NUM_SIGS, SCM_SYMBOL_SLOTS, SCM_SLOTS, SCM_SLOPPY_STRINGP,
+SCM_VALIDATE_STRINGORSUBSTR, SCM_FREEP, SCM_NFREEP, SCM_CHARS, SCM_UCHARS,
+SCM_VALIDATE_ROSTRING, SCM_VALIDATE_ROSTRING_COPY,
+SCM_VALIDATE_NULLORROSTRING_COPY, SCM_ROLENGTH, SCM_LENGTH, SCM_HUGE_LENGTH,
+SCM_SUBSTRP, SCM_SUBSTR_STR, SCM_SUBSTR_OFFSET, SCM_COERCE_SUBSTR
+
+Use SCM_ASSERT_RANGE or SCM_VALIDATE_XXX_RANGE instead of SCM_OUTOFRANGE.
+Use scm_memory_error instead of SCM_NALLOC.
+Use SCM_STRINGP instead of SCM_SLOPPY_STRINGP.
+Use SCM_VALIDATE_STRING instead of SCM_VALIDATE_STRINGORSUBSTR.
+Use SCM_FREE_CELL_P instead of SCM_FREEP/SCM_NFREEP
+Use a type specific accessor macro instead of SCM_CHARS/SCM_UCHARS.
+Use a type specific accessor instead of SCM(_|_RO|_HUGE_)LENGTH. 
+Use SCM_VALIDATE_(SYMBOL|STRING) instead of SCM_VALIDATE_ROSTRING.
+Use SCM_STRING_COERCE_0TERMINATION_X instead of SCM_COERCE_SUBSTR.
+
+** Removed function:  scm_struct_init
+
+** Deprecated function:  scm_call_catching_errors
+
+Use scm_catch or scm_lazy_catch from throw.[ch] instead.
+
+** Deprecated function:  scm_strhash
+
+Use scm_string_hash instead.
+
+** Deprecated function:  scm_vector_set_length_x
+
+Instead, create a fresh vector of the desired size and copy the contents.
+
+** scm_gensym has changed prototype
+
+scm_gensym now only takes one argument.
+
+** New function: scm_gentemp (SCM prefix, SCM obarray)
+
+The builtin `gentemp' has now become a primitive.
+
+** Deprecated type tags:  scm_tc7_ssymbol, scm_tc7_msymbol, scm_tcs_symbols,
+scm_tc7_lvector
+
+There is now only a single symbol type scm_tc7_symbol.
+The tag scm_tc7_lvector was not used anyway.
+
+\f
 Changes since Guile 1.3.4:
 
 * Changes to the distribution
@@ -95,6 +359,12 @@ objects.
 
 * Changes to the stand-alone interpreter
 
+** New command line option --debug
+
+Start Guile with debugging evaluator and backtraces enabled.
+
+This is useful when debugging your .guile init file or scripts.
+
 ** New help facility
 
 Usage: (help NAME) gives documentation about objects named NAME (a symbol)
@@ -246,6 +516,23 @@ GUILE_INIT_SEGMENT_SIZE_2, GUILE_MIN_YIELD_2
 (See entry "Way for application to customize GC parameters" under
  section "Changes to the scm_ interface" below.)
 
+** Guile now implements reals using 4-word cells
+
+This speeds up computation with reals.  (They were earlier allocated
+with `malloc'.)  There is still some room for optimizations, however.
+
+** Some further steps toward POSIX thread support have been taken
+
+*** Guile's critical sections (SCM_DEFER/ALLOW_INTS)
+don't have much effect any longer, and many of them will be removed in
+next release.
+
+*** Signals
+are only handled at the top of the evaluator loop, immediately after
+I/O, and in scm_equalp.
+
+*** The GC can allocate thread private pools of pairs.
+
 * Changes to Scheme functions and syntax
 
 ** close-input-port and close-output-port are now R5RS
@@ -572,6 +859,18 @@ respectively before callong scm_boot_guile.
 
 ** scm_protect_object/scm_unprotect_object now nest
 
+This means that you can call scm_protect_object multiple times on an
+object and count on the object being protected until
+scm_unprotect_object has been call the same number of times.
+
+The functions also have better time complexity.
+
+Still, it is usually possible to structure the application in a way
+that you don't need to use these functions.  For example, if you use a
+protected standard Guile list to keep track of live objects rather
+than some custom data type, objects will die a natural death when they
+are no longer needed.
+
 ** Deprecated type tags:  scm_tc16_flo, scm_tc_flo, scm_tc_dblr, scm_tc_dblc
 
 Guile does not provide the float representation for inexact real numbers any
@@ -597,6 +896,8 @@ until this issue has been settled.
 (This was introduced already in release 1.3.4 but was not documented
  until now.)
 
+** gdb_print now prints "*** Guile not initialized ***" until Guile initialized
+
 * Changes to system call interfaces:
 
 ** The "select" procedure now tests port buffers for the ability to
@@ -2562,9 +2863,9 @@ inherits the print-state of OLD-PORT.
 
 ** New constants: vtable-index-layout, vtable-index-vtable, vtable-index-printer
 
-** There is now a fourth (optional) argument to make-vtable-vtable and
-   make-struct when constructing new types (vtables).  This argument
-   initializes field vtable-index-printer of the vtable.
+** There is now a third optional argument to make-vtable-vtable
+   (and fourth to make-struct) when constructing new types (vtables).
+   This argument initializes field vtable-index-printer of the vtable.
 
 ** The detection of circular references has been extended to structs.
 That is, a structure that -- in the process of being printed -- prints