[squeak-dev] Implementing a "prototype" in Squeak

Randal L. Schwartz merlyn at stonehenge.com
Sat Apr 24 15:22:05 UTC 2010

>>>>> "Miso" == Miso  <fojtik at gmail.com> writes:

Miso> Hi, I'm trying to creating a concept similar to "prototype" (like
Miso> prototype-oriented programming) in Squeak. What I want is an
Miso> object's methodDictionary to be stored in itself. So when I send a
Miso> message to an instance, Squeakshould look in the instance's
Miso> dictionary (as opposed to class' dictionary) and call method
Miso> stored there.

Miso> Closest thing I managed to do was create an anonymous class
Miso> (subclass on my custom class) for each instance and return
Miso> instance of this class, and store the anonymous class in the
Miso> instance so I can work with it. Is there any other way to do it,
Miso> without modifying compiler/VM or writing custom compiler? If not,
Miso> please give some pointers where to look for some information about
Miso> "core" of Squeak.

One of the responses to my thread about anon classes at


brings up an oroboros, which is esssentially what you're looking for.

Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn at stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion

More information about the Squeak-dev mailing list