[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: a clarification and/or a small modification
Thanks for the clarification. I took a second look at the expansion:
(constructor constructor-tag ...)
(field-tag accessor . more) ...)
(make-record-type 'type '(field-tag ...)))
(record-constructor type '(constructor-tag ...)))
;; For some reason, I had read a 'type in this line.
;; As is, we have the equivalent of a gensym here. Thanks.
(define (record-predicate type)
(and (record? thing)
(eq? (record-type thing)
Okay, the problem is that an internal DEFINE expands into a LETREC,
so the BEGIN expansion above won't work.
[This does the question whether we want an option. I modifed Andrew Wright's
match package so that people who loaded the file could choose whether they
wanted datatype or type semantics. In Scheme, very little speaks for the
latter, but in soft-typed Scheme, the latter is what we must choose as a
Why don't you stipulate that SRFI-9 implementors allow DEFINE-RECORD-TYPE
wherever DEFINE is allowed, but add that implementations may raise an error
for internal DEFINE-RECORD-TYPEs (I wish they could for internal DEFINEs).
Then you could provide a reference implementation that raises an error.
Thanks. -- Matthias