[lively-kernel] [General] Redefining the Class of Instantiated Morphs, Subclassing Instantiated Morphs on the Fly

Sean P. DeNigris sean at clipperadams.com
Wed Feb 19 20:49:21 CET 2014


Tim Felgentreff-2 wrote
> The lively devs have struggled with various attempts to solve this
> problem

In Self, one can share behavior among copies quite easily by defining a new
parent before making the copies of the morph. By default, a Morph has
"traits Morph" as its parent. What you do is make a new object to be the
parent and inject between your morph and "traits Morph" (it is your morph's
parent and "traits Morph" is its parent). Then you add shared behavior to
the shared (between copies of your morph, but not all morphs) parent.

I don't know much about js, but could one be able to inject a new prototype
between the morph and the Morph class and add (or be able to promote)
behavior to it?



-----
Cheers,
Sean
--
View this message in context: http://forum.world.st/Re-General-Redefining-the-Class-of-Instantiated-Morphs-Subclassing-Instantiated-Morphs-on-the-Fly-tp4744953p4744959.html
Sent from the Lively Kernel mailing list archive at Nabble.com.


More information about the lively-kernel mailing list