Edit history: 2004-07-20, Version 1 by Bruno Haible
Status: For CLiki consideration
- Problem Description:
- Under CLHS rules, (EQUAL proper-list circular-list) may fail to terminate, but in all known implementation it will terminate
- Proposal (EQUAL-CIRCULAR-LIST:ALLOW):
- Change "EQUAL may fail to terminate if x or y is circular" to "if x and y are circular", so that (equal t '#1=(nil #1#)) is required to terminate.
- Test case:
- (equal '(a b c) '#1=(a b . #1#))
- All reasonable implementations of EQUAL behave this way.
- Current practice:
- SBCL and CLISP implement ALLOW.
- Cost to Implementors:
- Cost to Users:
- Cost of Non-Adoption:
- Users who assume a normal recursive implementation of EQUAL are trapped into pitfalls.
- Legalize existing practice.
- Bruno Haible says: I agree with proposal ALLOW. It is common practice to use (equal proper-list circular-list). The standard should allow it.