5.5 Records

SCM provides user-definable datatypes with the same interface as SLIB, see See Records in SLIB, with the following extension.

Function: record-printer-set! rtd printer

Causes records of type rtd to be printed in a user-specified format. rtd must be a record type descriptor returned by make-record-type, printer a procedure accepting three arguments: the record to be printed, the port to print to, and a boolean which is true if the record is being written on behalf of write and false if for display. If printer returns #f, the default record printer will be called.

A printer value of #f means use the default printer. This is the initial state of any rtd.

A printer value of #t means use a verbose printer, which will print the name and value of all record members. This option may cause trouble for recursive structures.

Only the default printer will be used when printing error messages.