the monopoly of classes

Andres Valloud sqrmax at comcast.net
Sat May 24 21:18:04 UTC 2003


Hi.

> hi again. i want to ask why must everything in squeak be a
> subclass of something. do you think it's rational?

It is a way to structure distinctions by behavior.  Look at the first
distinction, Object.  Object represents the distinction between
everything you can distinguish and the rest.  Of all the things you may
distinguish, you may be interested in say Magnitudes.  Then in Numbers,
Integers and SmallIntegers.  And so on.

Classes are a way to organize these distinctions by behavior so as to
avoid restating your intentions all over the place.  For instance if you
want every single object in the image to understand #yourself, you just
make the instances of Object understand it and that's it.  See how the
comparison selectors are implemented in Magnitude for instance.

Classes are not the only way to do this, though.  They are more an
implementation artifact than a necessity.

Andres.



More information about the Squeak-dev mailing list