*** empty log message ***
authorMarius Vollmer <mvo@zagadka.de>
Wed, 4 Jun 1997 22:42:29 +0000 (22:42 +0000)
committerMarius Vollmer <mvo@zagadka.de>
Wed, 4 Jun 1997 22:42:29 +0000 (22:42 +0000)
NEWS
ice-9/ChangeLog
libguile/ChangeLog

diff --git a/NEWS b/NEWS
index 0c0cf30..f7a17d3 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -40,6 +40,27 @@ instead write
 
 The latter syntax is more consistent with existing Lisp practice.
 
+** Guile now does fancier printing of structures.  Structures are the
+underlying implementation for records, which in turn are used to
+implement modules, so all of these object now print differently and in
+a more informative way.
+
+The Scheme printer will examine the builtin variable
+*struct-printer* whenever it needs to print a structure object.  When
+this variable is not `#f' it is deemed to be a procedure and will be
+applied to the structure object and the output port.  When
+*struct-printer* is `#f' or the procedure return `#f' the structure
+object will be printed in the boring #<struct 80458270> form.
+
+This hook is used by some routines in ice-9/boot-9.scm to implement
+type specific printing routines.  Please read the comments there about
+"printing structs".
+
+One of the more specific uses of structs are records.  The printing
+procedure that could be passed to MAKE-RECORD-TYPE is now actually
+called.  It should behave like a *struct-printer* procedure (described
+above).
+
 ** Guile now supports a new R4RS-compliant syntax for keywords.  A
 token of the form #:NAME, where NAME has the same syntax as a Scheme
 symbol, is the external representation of the keyword named NAME.
index 8638a32..cc132e0 100644 (file)
@@ -1,3 +1,14 @@
+Wed Jun  4 23:27:16 1997  Marius Vollmer  <mvo@zagadka.ping.de>
+
+       * boot-9.scm (struct-layout, %struct-printer-tag, struct-printer,
+       make-struct-printer, set-struct-printer-in-vtable!): New bindings
+       to support printing of structures.
+        (record-type-vtable, make-record-type): Add slot to hold printing
+       function and initialize it with something appropriate.  Removed
+       commented out printing code.
+       (record-type-name, record-type-fields): Adjusted slot offsets.
+       (%print-module): Reduce argument list to "mod" and "port".
+       
 Sat May 31 18:57:12 1997  Gary Houston  <ghouston@actrix.gen.nz>
 
        * boot-9.scm: signal-handler, alarm-thunk: removed.
index 3ae81d9..4096390 100644 (file)
@@ -1,3 +1,12 @@
+Wed Jun  4 23:47:01 1997  Marius Vollmer  <mvo@zagadka.ping.de>
+
+       * struct.c (struct_printer): New variable that holds a handle on
+       the Scheme variable *struct-printer*.  This variable can be set by
+       Scheme code to override the printing of structures.
+       (scm_print_struct): If struct_printer is set, call it.  If it is
+       not set, or returns #f, print the structure in the old fashion.
+       Include "eval.h" for scm_apply.
+       
 Tue Jun  3 23:01:39 1997  Marius Vollmer  <mvo@zagadka.ping.de>
 
        * struct.c (scm_struct_ref, scm_struct_set_x): Use