[Cuis] [SOLVED] Re: Copy vs Clone
Ken.Dickey
Ken.Dickey at whidbey.com
Thu May 14 09:23:15 CDT 2015
On Thu, 14 May 2015 11:03:29 -0300
Juan Vuletich <juan at jvuletich.org> wrote:
> > The original Object>>copy would work where I implement postCopy to set location to a new MorphicTranslation.
> >
> > Object>>copy
> > ^self shallowCopy postCopy
>
> But the problem with this is that the original and the copy would share
> that state embedded in the closure... They would also share submorphs, etc.
In this case, that is the desired outcome.
> Can you help me reproduce the problem with the closure? I think the best
> would be to make that closure a "clean" one, storing any needed state in
> the morph (maybe as properties), and accessing it via messages to self...
Hmmm.. I'll have to send you the image.
I have things taken apart and a bunch of parts all over the floor.. I have yet to comstruct a clean change-set.
> Sometimes I think it would be nicer if all closures were clean. I'm not
> really sure what would we lose with such restriction...
I think you are tired. You would lose _closures_!
--
-KenD
More information about the Cuis
mailing list