[R6RS] record types and UIDs

Michael Sperber sperber at informatik.uni-tuebingen.de
Sat Feb 25 06:01:38 EST 2006


Thanks for going over the records draft!

Matthew Flatt <mflatt at cs.utah.edu> writes:

> When the same `uid' is supplied to two different calls to
> `make-record-type-descriptor', all the other arguments are required to
> be equivalent (`eqv?' or `equal?', as appropriate).
>
> The SRFI doesn't say what happens if the other arguments not all equal.

That's not true---it says:

>> If a call with the same uid differs in any argument, an error is
>> signalled.

> Would it make sense to change the `uid' argument to a `uid-prefix'
> argument that's combined with all the other arguments to produce the
> true UID? Then there's no question of incompatible UID mappings.

It's a tricky question.

Imagine I work in an interactive system and I define a non-generative
record type, create a bunch of records off that type, and then make a
change to the record type and re-evaluate it.  If the system lets me
do it, as you propose, and I pass the old records into procedures that
are meant for the new type, errors are signalled.  Now, the system
needs to explain to the user what's gone wrong.  That's hard enough if
the names of the record types are the same---if the uids are the same,
I think it'll be worse.  (I've certainly often been confused by
exactly that situation.)

That's why I'd prefer if the system would alert me to this potential
source of confusion, as it's likely not what I intended.  Presumably,
an interactive Scheme system needs to offer some way of "starting from
scratch" (as DrScheme), or undefining a non-generative record type
that's in the system, in the same way as a Scheme system might offer a
way of removing existing bindings (as Scheme 48).  I'm not sure that
part needs to be standardized---but it could, as part of the
procedural interface.

-- 
Cheers =8-} Mike
Friede, Völkerverständigung und überhaupt blabla



More information about the R6RS mailing list