[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Update available-- possibly last before finalization

This page is part of the web mail archives of SRFI 57 from before July 7th, 2015. The new archives for SRFI 57 contain all messages, not just those from before July 7th, 2015.



David Van Horn wrote:
Hello,

SRFI 57 has been updated and the latest draft is now available at:

   http://srfi.schemers.org/srfi-57/

The update consists of a small bug fix in the code and a minor reorganization of the text. This will be last revision before finalization (Jan 8) unless there are further comments, so please speak up if you have an issue with the current draft.


Hm... Non-generative record definitions would be nice.
Here an excerpt from the Chez Scheme release notes (6.9c):

--
2.33. Records and generativity (6.9)

Each record type is associated with a unique generated name, or gensym. This gensym is used to identify the record type in the printed and compiled representations of each record of the type. When the name argument to make-record-type is a gensym, this gensym is used; otherwise a new gensym is created. If make-record-type is invoked more than once with the same gensym and the record fields match, the same record type descriptor is returned. If the record fields do not match, an error is signaled. This permits the programmer to control the generativity of record types; full nongenerativity is achieved by passing a gensym, and various levels of generativity are achieved by passing in a non-gensym at expansion time or run time.

define-record is ordinarily expansion-time generative, meaning that each time an expression is expanded, e.g., when it is contained in a file loaded for source or compiled by compile-file, a new record type is constructed. If the name of the record is specified as a gensym, however, the record type is fully nongenerative. This allows the programmer to place two identical definitions of a record type in two files to be separately compiled or loaded. Only the pretty name of the gensym is used in forming the variables naming the record constructor, predicate, accessors, and setters. For example:

(define-record foo ((immutable a)))

and

(define-record #{foo |*5CNSgDOG8+wd\\%|} ((immutable a)))

each implicitly define make-foo, foo?, and foo-a, but the latter is nongenerative while the former is expansion-time generative.
--


cheers,
felix