John Cowan quoting me:

> > Among other things, it's worth noting that Java does not require
> > the equals(Object) method to agree with == (which is Java's
> > closest equivalent to Scheme's eq?) on function objects such as
> > comparators.  
> 
> I'm not sure I understand this.  If two objects (not of primitive type)
> are ==, they are necessarily also equals(), but of course not vice versa.
> The general contract for equals() guarantees the first part, and good
> implementation technique is for the first statement of equals(Object that)
> in any class to be "if (this == that) return true;".

Yes, and that's precisely the guarantee that should have been
made by the Scheme standards.  Instead, the R5RS and R6RS went
beyond that guarantee by overspecifying:  Both the R5RS and
R6RS insist that eq? and eqv? "have the same behavior" on
procedures, i.e.

    (eq? proc1 proc2) if and only if (eqv? proc1 proc2).

That overspecification was a mistake.  I hope it will be fixed
in some future standard for Scheme.

Will

_______________________________________________
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss

Reply via email to