[R6RS] R6RS records: record equality

Marc Feeley feeley
Sun Aug 28 22:09:00 EDT 2005

On 28-Aug-05, at 10:10 AM, Michael Sperber wrote:

> Marc Feeley <feeley at iro.umontreal.ca> writes:
>> The specification indicates that two records are equal? iff they are
>> eq? (except if they represent builtin types like pairs, vectors,  
>> etc).
>> I object to the "equal? iff eq?" because it limits the use of  
>> records.
>> I would prefer a recursive definition where (equal? r1 r2) is true  
>> iff
>> r1 and r2 are of the same record type, and for each field, the  
>> contents
>> of that field in r1 and r2 are equal?.
> I'll be happy to put this up in the issue bullet, but I think it would
> be a really bad idea.  The current definition doesn't limit the use of
> records, but it does limit the use of EQUAL?.

If "equal? iff eq?", you can't use records as keys to access tables  
(as explained in my previous message).  So this is a limitation of  
the uses of records.

>   I believe that's a good
> thing, for the reasons that came up in the discussion of this in
> Snowbird.

Could you be more explicit.  I don't follow why you think this is a  
bad idea.  Given that records can be tested with eq? if the user  
wants to, why is it necessary for equal? to behave the same, and  
counter-intuitively to what happens for pairs, vectors and strings?


More information about the R6RS mailing list