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

[Scheme-reports] Equality of records



Draft 6 requires that `equal?` recursively descend into records.  However,
the WG did not explicitly vote for this feature, nor is it mentioned
in SRFI 9, which is our source document for records.  In addition,
R6RS explicitly forbids it, requiring that all objects except pairs,
vectors, strings, and bytevectors be compared with `eqv?`.  Therefore,
I have applied the following diff:

-The {\cf equal?} procedure recursively compares the contents of pairs, vectors,
-strings, bytevectors, and records,
-applying {\cf eqv?} on other objects such as numbers and symbols.
-If two objects are {\cf eqv?}, they must be {\cf equal?} as well.
+The {\cf equal?} procedure recursively compares the contents of pairs,
+vectors, strings, and bytevectors, applying {\cf eqv?} on booleans,
+symbols, numbers, characters, ports, procedures, and the empty list.
+If two objects are {\cf eqv?}, they must be {\cf equal?} as well.  In all
+other cases, implementations may return either \schtrue{} or \schfalse{}.

In addition, the phrase "other objects such as numbers and symbols"
(inherited from R5RS) is not clear.  Does it mean all other objects,
or only some of them?  I have spelled out the list of standard types
requiring `eqv?` behavior.

Comments?

-- 
In my last lifetime,                            John Cowan
I believed in reincarnation;                    http://www.ccil.org/~cowan
in this lifetime,                               cowan@x
I don't.  --Thiagi

_______________________________________________
Scheme-reports mailing list
Scheme-reports@x
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports