Instance-specific behavior question (like Ruby?)
avi at beta4.com
Tue Mar 23 09:07:17 UTC 2004
On Mar 23, 2004, at 12:00 AM, Poster at Kinetium dot Com wrote:
> I am somewhat familiar with the idiom of doing instance specialization
> overriding "doesNotUnderstand".
> Ruby provides a different and more direct way of doing such prototype
> programming: it simply makes the instance belong to a new (anonymous)
> and puts any instance-specific behavior on that class. It provides a
> to define that behavior (since the class is anonymous).
> Is there a way to do this in Squeak? I'm a relative Squeak newbie ...
Sure. See my Singletons package on SqueakMap, which implements
singleton methods exactly the same way Ruby does.
More information about the Squeak-dev