[r6rs-discuss] [Scheme-reports] redefining eqv?
cowan at mercury.ccil.org
Fri Dec 24 04:19:18 EST 2010
Peter Kourzanov scripsit:
> BTW...Can someone with enough grey hairs remember why we have the horde
> of predicates like =, eq?, equal? and eqv? What I understood is that
> eqv? is sort-of one-size-fits-all idea gone astray
EQV? is object equality, the identity of indiscernibles. EQ? is an
variant of EQV? that can answer #f on on characters and numbers in exchange
for (hopefully) better performance.
= is type-specific equality on numbers, and corresponds to things like
CHAR=? and STRING=?.
EQUAL? was originally structural equality, but the exact way it works
is historical: it descends into pairs, vectors, and strings, but works
like EQV? on all other types. Programmers are encouraged to substitute
a different structural-equality predicate if EQUAL? doesn't suit their
needs: it is not primitive.
The proposed EQUAL=? will be like EQUAL, but will employ = rather than
EQV? to compare numbers.
Híggledy-pìggledy / XML programmers John Cowan
Try to escape those / I-eighteen-N woes; http://www.ccil.org/~cowan
Incontrovertibly / What we need more of is cowan at ccil.org
Unicode weenies and / François Yergeaus.
More information about the r6rs-discuss