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 [email protected] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
