[Cuis] Copy vs Clone

David T. Lewis lewis at mail.msen.com
Wed May 13 20:39:35 CDT 2015


On Wed, May 13, 2015 at 09:19:56PM -0400, Dan Norton wrote:
> On 13 May 2015 at 15:41, Ken.Dickey wrote:
> 
> > I am seeing a strange behavior.
> > 
> > The simple way to see it is to make a child class of PartsBinMorph. 
> > Call it, say, PartsBinTestMorph.
> > 
> > Add a method #PartsBinTestMorph>>
> >   aboutToGrab: aMorph
> > 
> > 	^aMorph clone "parent has aMorph copy"
> > 
> > WHen I obtain a PartsBinMorph from the new morph menu, then add,
> > say, a ellipse morph, I get the expected behavior.  WHen I "drag the
> > ellipse out", the hand gets a copy of the ellipse and the original
> > ellipse remains where I can see it.
> > 
> > But doing the same thing in a PartsBinTestMorph, I appear to grab
> > the ellipse.
> > 
> > Now it turns out that the original ellipse is still a submorph of
> > the PartsBinTestMorph, but it's morphPosition seems to be set to
> > some random value.
> > 
> > I tried saving the original morphPosition, doing the clone, then
> > resetting the saved morphPosition, but this does not change
> > anything.
> > 
> > Unfortunately, my copy of the blue book is saved in a box somewhere
> > (I am moving), so I don't have a spec for #clone.
> > 
> 
> Searching my copy of BlueBook.pdf for clone comes up empty.

Checking the wayback machine at try.squeak.org, I tried loading the
Squeak1.13u.image under SqueakJS. I do not see an Object>>clone, so
#clone probably did not exist when the blue book was written.

http://try.squeak.org/#url=http://freudenbergs.de/bert/squeakjs&files=[Squeak1.13u.image,Squeak1.13u.changes,SqueakV1.sources]&swapButtons=true

Dave
 




More information about the Cuis mailing list