[Pharo-project] Issue 3657 in pharo: [Enh] Simple EqualityTest

pharo at googlecode.com pharo at googlecode.com
Sat Feb 5 09:49:32 CET 2011


Status: New
Owner: ----

New issue 3657 by bouraq... at gmail.com: [Enh] Simple EqualityTest
http://code.google.com/p/pharo/issues/detail?id=3657

Simple solution to ease implementing = and hash.
To make instances of some class comparable, simply make the class use the  
TEquality trait.

TEquality relies on message valuesToCompareForEquality sent to objects for  
both = and hash.
The default implmentation of this message is provided by Object.
Override ONLY valuesToCompareForEquality method for custom equality check.

Paste or attach stack trace if applicable (look at the file PharoDebug.log
located in the same directory as your image):


Attachments:
	Equals-NouryBouraqadi.1.mcz  3.3 KB





More information about the Pharo-project mailing list