Hi, If you look at Object: Object numberOfMethods 449 Object linesOfCode 2356 I have somehow the feeling that there is some other stuff that we should remove before thinking about removing equality... Marcus On 24.09.2008, at 18:14, Bill Schwab wrote:
I have always seen defaulting equality to identity to be a useful confusion, and I fear it would simply be copied down (often in frustration) into many classes vs. done once. It also removes a compatibility with other Smalltalks, which I think we should be working to maintain and enhance where it is not destructive to do so. Just my 2 asCents.
Bill
Wilhelm K. Schwab, Ph.D. University of Florida Department of Anesthesiology PO Box 100254 Gainesville, FL 32610-0254
Email: bschwab@anest.ufl.edu Tel: (352) 273-6785 FAX: (352) 392-7029
diegogomezdeck@consultar.com 09/24/08 9:30 AM >>> Hi guys,
I recently discovered Pharo project and I'd like to fire a proposal for cleaning Object class.
The "simple" idea is to remove equality concept (implemented with #= and #hash messages) from Object.
Equality means that different instances can represent the same value (like Numbers, Strings, Dates, etc). Identity means that any object is a different object from any other from the world.
All objects have identity (#== and #basicHash messages), but not all object share the equality concept. To make the things worst, the default implementation of equality is based on the identity, producing a big confusion to newbies (and experts too!).
One implementation option is to implement the Equality concept in a super-class of Magnitude (Comparable?), and reused all over the class hierarchy with traits.
Of course such factorization will impact also on the Collections that (most of them) also confuses equality with identity. Probably some collections will need an Strategy-pattern to use identity or equality based behavior.
What do you think?
Cheers,
-- Diego
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- Marcus Denker -- denker@iam.unibe.ch http://www.iam.unibe.ch/~denker