[R6RS] relationships between uid, <record name>, and rtd
William D Clinger
will at ccs.neu.edu
Tue Mar 7 14:55:44 EST 2006
SRFI 76 (R6RS Records) talks about three seemingly related
One of the issues says
There is no way to use a record-type descriptor created by an
explicit call to make-record-type-descriptor as a parent type
in a define-record-type form. Should this be rectified, for
example by another define-record-type clause named parent-rtd?
That paragraph does not appear to be consistent with the rest
of the SRFI. A programmer can obtain a record-type descripter
from a record-name via
(record-type-descriptor <record name>) (syntax)
This evaluates to the record-type descriptor associated with
the type specified by <record-name>.
Note that record-type-descriptor works on both opaque and
non-opaque record types.
A programmer can also obtain a name from a record-type-descriptor
Returns the name of the record-type descriptor rtd.
I foolishly assumed that the record-type-descriptor and the
record-type-name procedure would be inverses, but maybe they
aren't. If not, then what is the relationship?
BTW, what kind of object is returned by the record-type-name
procedure? The explicit-naming spec says
<Record name>, <constructor name>, and <predicate name> must all
<Record name> becomes the name of the record type. Additionally,
it is bound by this definition to an expand-time or run-time
description of the record type for use as parent name in
syntactic record-type definitions that extend this definition.
It may also be used as a handle to gain access to the underlying
record-type descriptor and constructor descriptor (see
record-type-descriptor and record-constructor-descriptor below).
But how can the record-type-name return an identifier? I think
it would have to return a symbol. If the record-type-descriptor
syntax and the record-type-name procedure are inverses, then I
think <record name> would just be a symbol.
If a <record name> is just a symbol, however, then there must be
some global table mapping symbols to record-type-descriptors.
Obviously there must be some such table for non-generative record
types, but why require such a thing for generative types?
Furthermore the procedural interface seems to imply some global
table mapping uids to record-type-descriptors. Am I right about
that? If so, what is the relationship between these two global
More information about the R6RS