w...@ccs.neu.edu scripsit:

> I misinterpreted your "universal polymorphism" to mean parametric
> polymorphism, with universal quantification over type parameters.

On investigation, I agree that I misused the term: I posted in haste
and now must repent at leisure.

> 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.

Just so.  "Universal ad-hoc polymorphism", perhaps.

> 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;".

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

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

Reply via email to