Opened 14 years ago

Closed 14 years ago

Last modified 12 years ago

#441 closed change request (fixed)

equal? may not recurse into closures

Reported by: felix winkelmann Owned by:
Priority: major Milestone: 4.9.0
Component: core libraries Version: 4.6.x
Keywords: equal? procedures Cc:
Estimated difficulty:

Description

Because it is impossible to avoid circular data when comparing closures and since equality of procedures is a difficult issue in general, the implementation of equal? should be changed to not descend recursively into procedures and comparing them with eq? instead.

This is a change-request, because such a change in the semantics of equal? may break existing code.

The discussion period will end on 2010-12-21.

Change History (8)

comment:1 Changed 14 years ago by Alaric Snell-Pym

I think that eq? is probably good enough for procedures, on account of the slipperiness of defining equality for them.

However, should equal? be extended to terminate on circular data (as R7RS may end up requiring), then recursing into procedures will also be good enough (and, indeed, perhaps slightly more useful than eq?).

One underlying issue is: Who compares procedures, anyway? What are their intentions and wishes?

comment:2 in reply to:  1 ; Changed 14 years ago by felix winkelmann

Replying to alaric:

One underlying issue is: Who compares procedures, anyway? What are their intentions and wishes?

When comparing records, some slots may contain procedures. Another case is hash-table keys - here procedures may appear contained in non-atomic data compared by equal?.

comment:3 in reply to:  2 ; Changed 14 years ago by Alaric Snell-Pym

Replying to felix:

Replying to alaric:

One underlying issue is: Who compares procedures, anyway? What are their intentions and wishes?

When comparing records, some slots may contain procedures. Another case is hash-table keys - here procedures may appear contained in non-atomic data compared by equal?.

Oh, indeed; but what is the desired outcome for people doing this? What are they trying to do?

comment:4 in reply to:  3 Changed 14 years ago by felix winkelmann

Replying to alaric:

Replying to felix:

Replying to alaric:

One underlying issue is: Who compares procedures, anyway? What are their intentions and wishes?

When comparing records, some slots may contain procedures. Another case is hash-table keys - here procedures may appear contained in non-atomic data compared by equal?.

Oh, indeed; but what is the desired outcome for people doing this? What are they trying to do?

Use arbitrary objects as hash-table keys.

comment:5 Changed 14 years ago by felix winkelmann

The discussion period has ended. Please give your vote on the following change:

Poll(Shall `equal?` be changed to not recurse into closure slots when comparing procedures?; Yes; No)?

comment:6 Changed 14 years ago by felix winkelmann

Resolution: fixed
Status: newclosed

No rejections, so this appears to be accepted.

comment:7 Changed 14 years ago by felix winkelmann

Milestone: 4.7.04.8.0

Milestone 4.7.0 deleted

comment:8 Changed 12 years ago by felix winkelmann

Milestone: 4.8.04.9.0

Milestone 4.8.0 deleted

Note: See TracTickets for help on using tickets.