Numeric comparison.

Matej Kosik kosik at fiit.stuba.sk
Thu Apr 21 15:07:48 UTC 2005


François THIMON wrote:
> I've already been watching so many pages from this site that I may have
> forgotten this one (or maybe I read it so long time ago that I can't
> remember...).
> 
> Thanks anyway!

Well these things are utterly explained in any good Smalltalk book. Take one, read it in confort and then you will not be dependent on the random information you find on the net or someone gives you. The page I've recommended doesn't contain all the information, of course. But may be sufficient for the beginning.

You might also perhaps take a look at the implementation of the Complex class (it is in 3.9 image, not in 3.7 I think). Look at how and why they overloaded the

	=

method. Note that when on overloads the = method, he/she also needs to overload the `hash' method. This is not on the page. It is related to the Dictionary class. Any object may be a key there and it is higly desirable that two perhaps non-identical but equivalent objects denote the same key. Play with the Complex (as a key) and a Dictionary.
-- 
Matej Kosik, icq://300133844, http://altair.dcs.elf.stuba.sk/wiki/Kosik/Main



More information about the Squeak-dev mailing list