John Cowan quoting me quoting him:

> > > Different definitions for different contexts.  SML equality has ad-hoc
> > > polymorphism; Scheme `eqv?` has universal polymorphism.
> > 
> > That's news to me.  Which of the Scheme reports/standards do you wish
> > to cite as your source?
> 
> Any of them will do:  given two values x, y, `(eqv? x y)` answers either
> #t or #f.  This is not the case in SML, where values cannot be compared
> unless they have the same type, and only certain types can be compared
> for equality at all.

I misinterpreted your "universal polymorphism" to mean parametric
polymorphism, with universal quantification over type parameters.
It looks as though you were really using that phrase to mean ad hoc
polymorphism with a domain that includes all objects, as with Java's
equals(Object), hashCode(), and toString() methods.

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.  As I explained earlier [1], the R5RS and R6RS
requirement for eq? and eqv? to agree on all procedure values
impedes implementation of the more useful behavior described by
Alaric Snell-Pym.

> I suppose you mean "have never been mutable".

Yes.  Thank you for that correction.

Will

[1] http://lists.r6rs.org/pipermail/r6rs-discuss/2012-July/006405.html

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

Reply via email to