On Sep 8, 2009, at 5:47 PM, John Cowan wrote: > I don't think there's anything to add to SRFI-9 as far as records for > Thing One are concerned, except a way to add a record-printer that > "display" and "write" would respect. The obvious strategy is to > interpret the fourth argument, if it is an identifier rather than a > list, as the name of a procedure to be called when printing is > required. > The resulting syntax is: > > (define-record-type typename (constructor args ...) predicate > [printer] > (field-tag accessor [mutator]) ...) > > Note that this is an "output" argument to define-record-type; it > specifies > not a procedure to be generated, but one to be invoked. > > Alternatively, we could provide separate syntax or even a procedure to > inform the reader what printer to use.
Can you explain why a record type-specific printer procedure is a good idea for Thing One? It seems to me that this approach falls between two stools: it doesn't provide the guaranteed consistency for all record types that standardizing a record print syntax would give, and it doesn't provide the functionality or print-read consistency that a general printer and reader customization would allow. -- Brian Mastenbrook [email protected] http://brian.mastenbrook.net/ _______________________________________________ r6rs-discuss mailing list [email protected] http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss
