semantics of #clone?

Yoshiki.Ohshima at acm.org Yoshiki.Ohshima at acm.org
Tue Jun 24 00:11:17 UTC 2003


  Josh,

> What are the semantics of #clone?  Object>>clone has no method
> comment.  How is it different from the intended meaning of
> #shallowCopy?

  I guess some other people have better ansser, but for me, #clone is
ensured to be more primitive and faster.  Since it doesn't nil-out or
zero-out the newly created object, it is faster for objects like
Bitmap.  In the other words, #clone is thin layer on the primitive,
while #shallowCopy has more flexibility to do something different.

# I somehow am feeling that #clone is added later, in 2.x days.

-- Yoshiki



More information about the Squeak-dev mailing list