Traits or not Traits that is the question

Michael van der Gulik mikevdg at gmail.com
Sun Feb 3 21:58:00 UTC 2008


On Feb 4, 2008 10:44 AM, nicolas cellier <ncellier at ifrance.com> wrote:

> Giuseppe Luigi Punzi Ruiz a écrit :
> > And, if is easy to extract from the image, and convert it to a package.
> > Why don't do it, and all happy?
> >
> > If you want Traits, load a package and voilá. If you don't want Traits,
> > don't install it.
> >
> > Only my impression.
> >
>
> Because modifying Class and Metaclass is quite a tricky game. It's like
> cutting the branch you are seating upon.
>
> Both adding or removing Traits is NOT trivial.
>
> But yeah, on the principle, you are right, that could be
>
>

>From what I can tell so far, there's nothing stopping you from making a
second class+metaclass kernel or hierarchy in the same image. The VM doesn't
make any sanity checks, so an object could have any other object as a class
provided that instvar 2 (? IIRC) is a sane method dictionary.

In other words, you can have traits and non-traits classes in the same
image.

The limitations are in "Smalltalk specialObjectsArray" and another array
(which I can't remember the name of) which stores 5-bit indexes to commonly
used classes. The classes in these arrays are used by the VM and need to be
shared by all your individual metaclass hierarchies.

Gulik.

-- 
http://people.squeakfoundation.org/person/mikevdg
http://gulik.pbwiki.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20080204/52cf214c/attachment.htm


More information about the Squeak-dev mailing list