Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#111 closed defect (wontfix)

Require EQUAL? to return #t if EQV? does

Reported by: cowan Owned by: alexshinn
Priority: major Milestone:
Component: WG1 - Core Keywords:


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.

Change History (8)

comment:1 Changed 6 years ago by arcfide

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.

comment:2 Changed 6 years ago by cowan

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.

comment:3 Changed 6 years ago by arcfide

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

comment:4 Changed 6 years ago by cowan

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

comment:5 Changed 6 years ago by arcfide

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

comment:6 Changed 6 years ago by cowan

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.

comment:7 Changed 6 years ago by cowan

  • Resolution set to wontfix
  • Status changed from new to closed

WG1 voted to take no action.

comment:8 Changed 6 years ago by cowan

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

Note: See TracTickets for help on using tickets.