MarkingKey
Stephen Pair
spair at advantive.com
Tue Jun 11 14:24:45 UTC 2002
Another technique used in Smalltalk where you need an object that can't
be confused with a real object in your domain is to simply instantiate a
new object and hold onto it (this works if you don't need it to me
polymorphically compatible with the objects in your domain):
(where Marker is a class var)
MyClass class>>initialize
Marker := Object new.
MyClass class>>isMarker: anObject
^anObject == Marker
This object will never be confused with an object in your domain.
- Stephen
More information about the Squeak-dev
mailing list
|