[squeak-dev] The Inbox: Graphics-cmm.329.mcz

Chris Muller asqueaker at gmail.com
Sat Apr 2 18:39:57 UTC 2016


> Why not adhere to the copy-on-write scheme for forms in Morphic? That’s how it was designed.
>
> E.g. when you make a green-handle copy of a SystemWindow, why would you want to deep-copy all the icons?

I don't.  I want to deepCopy the form bits when I invoke the
green-halo it on a SketchMorph, not a SystemWindow.  That's what
Morph-cmm.1096 does, without affecting it when copying SystemWindows
or anything else besides a SketchMorph.

But you said the problem with that is that Etoys students are putting
their behaviors directly on SketchMorphs instead of something more
abstract like a PlayerMorph.  With a PlayerMorph they could set his
#fillStyle to some Form which would still share on veryDeepCopy, and
yet with my #veryDeepFixup: in SketchMorph, the green-halo would ALSO
work properly when invoked directly on a SketchMorph -- the best of
both worlds.

But we have to break this common use-case so that this design choice
to use SketchMorphs everywhere, will be more memory-efficient..
Sigh..

>> Instead, before you modify a form (which is an extremely rare operation compared to all uses of forms), make a copy of it.

As I said, that's exactly what I did -- or thought I was doing.  I
just did it via the green halo because I expected it to behave as it
does on all other Morphs -- to make a meaningfully separate copy.


More information about the Squeak-dev mailing list