diff --git a/NEWS b/NEWS index 0c0cf3031..f7a17d30f 100644 --- 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 # 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. diff --git a/ice-9/ChangeLog b/ice-9/ChangeLog index 8638a329d..cc132e049 100644 --- a/ice-9/ChangeLog +++ b/ice-9/ChangeLog @@ -1,3 +1,14 @@ +Wed Jun 4 23:27:16 1997 Marius Vollmer + + * 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 * boot-9.scm: signal-handler, alarm-thunk: removed. diff --git a/libguile/ChangeLog b/libguile/ChangeLog index 3ae81d96d..4096390f9 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,3 +1,12 @@ +Wed Jun 4 23:47:01 1997 Marius Vollmer + + * 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 * struct.c (scm_struct_ref, scm_struct_set_x): Use