[squeak-dev] Towards clean unloading Morphic (an idea)

Eliot Miranda eliot.miranda at gmail.com
Thu May 20 16:43:24 UTC 2010


Hi Igor,

On Thu, May 20, 2010 at 2:47 AM, Igor Stasenko <siguctua at gmail.com> wrote:

> Hello,
>
> i just thought, that in order to get down to a minimal kernel image,
> it would be nice to move all Morphic globals into a shared pool.
>
> Things like, World, ActiveWorld
> could be placed into a MorphicPool class.
>
> Then we can make an easy transition
> 1. add this pool to classes which using that global & recompile them
>
> 2. for classes, which should have no dependency from Morphic,
> use a messages like
>
> Object >> currentWorld
>   ^ (Smalltalk at: #MorphicPool ifAbsent: [ self error: 'bummer' ])
> currentWorld .
>
> Then, i hope, you can unload the Morphic using MC and it will leave no
> trace in an image (or at least less trace than usual ;).
>
> Same could be applied to Graphics package (to get rid a Display global)
>

Good idea.  This is a little like a poor man's namespaces.  It suggests the
following cheap hack namespaces:

Inside Smalltalk all the Morphic class names are #'Morphic.Morph'
 #'Morphic.TheWorldMenu' etc.  Inside the MorphicNamespace shared pool they
are #Morph #TheWorldMenu etc.  The bindings for these would have to be
shared between Smalltalk and the MorphicNamespace shared pool.  I guess
something like a smart subclass of VariableBinding that when decompiling
printed itself differently depending on whether its home pool was in scope
or not might make the sleight-of-hand invisible.  You'd also need to hack
the browsers to prune the Morphic. prefix when the selected category began
with Morphic.  Is this a primrose path, a slippery slope or a worth-while
experiment?

best
Eliot


> --
> Best regards,
> Igor Stasenko AKA sig.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20100520/04307602/attachment.htm


More information about the Squeak-dev mailing list