guile-user
[Top][All Lists]
Advanced

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

SRFI-9 and `equal?'


From: Ludovic Courtès
Subject: SRFI-9 and `equal?'
Date: Tue, 06 Jun 2006 16:33:40 +0200
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/21.4 (gnu/linux)

Hi,

I posted the following thing on `comp.lang.scheme' but got no answer.

SRFI-9 apparently does not specify the behavior of `equal?' with record
instances.  Consider the following example:

 (define-record-type <chbouib>
   (make-chbouib obj)
   chbouib?
   (obj chbouib:obj chbouib:set-obj!))

 (equal? (make-chbouib 1) (make-chbouib 1))

According to R5RS, if the two `chbouib' instances print equally, they
should be `equal?'.

On Chicken, the two instances do print equally and Chicken considers
them `equal?'.  On Guile, the two instances print equally but are _not_
considered `equal?'.

To me, it looks like having `equal?' behave "as one may expect" (i.e.,
as in the Chicken case) would be very valuable and look more consistent
wrt. R5RS --- although, admittedly, relying on it would be Bad.

What do you think?

Thanks,
Ludovic.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]