This site is a static rendering of the Trac instance that was used by R7RS-WG1 for its work on R7RS-small (PDF), which was ratified in 2013. For more information, see Home.

Ticket 111: Require EQUAL? to return #t if EQV? does

2011-01-24 07:06:44
WG1 - Core
2010-12-07 00:05:14

Shall we require equal? to return #t if eqv? does? This would make it possible to compare potentially circular lists or trees for equality provided they are the same in the sense of eqv?.

This is a common implementation hack in many Lisps, but has never been standardized.

It already is defined to use eqv? in most cases excepting pairs and vectors, so I do not really see a need to require this. There is no difference whether we require this or not as it won’t change any results.

Yes, it will. Given two circular lists as arguments, equal? will loop on them unless they are eqv?, in which case it will return #t under this proposal. In R5RS it may do either.

The result is the same however. They will return #t in either case. It cannot return #f.

The result is not the same. Possible non-termination is not the same as being guaranteed to return #t.

Since when is it non-terminating? Wait, I just saw the ticket, I feel like something is seriously wrong here.

Per #51, we keep the R5RS definition of equal?, in which it "may fail to terminate if its arguments are circular data structures". You seem to be thinking of the R6RS definition, which did not pass WG1.


WG1 voted to take no action.

Correction: WG1 voted to accept this, but it is redundant with its vote on #51.