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

Consider a different define-record-type syntax



It is inconsistent that define-record-type provides succinct <field
spec> which automatically make names for the accessor and mutator but it
requires (annoyingly, not succinctly) using, and remembering to use, #t
#t to get it to automatically make names for the constructor and
predicate.  I imagine it's like that to be compatible with SRFI-9, but
how important is that compatibility, i.e., how much will that
compatibility be used into the longer-term future?  I'd much rather have
define-record-type's syntax be:

<record type definition>
   -> (define-record-type <type spec>
        <field spec> ...)

<type spec>  -> <type name>
             -> (<type name> <parent>)
             -> (<type name> <parent> <constructor spec> <predicate spec>)

The first two <type spec> do automatic naming for the constructor and
predicate.  The last uses <constructor spec> and <predicate spec> the
same as the current draft describes.

-- 
: Derick
----------------------------------------------------------------