Difference between Object>>clone and Object>>shallowCopy

Stephane Ducasse ducasse at iam.unibe.ch
Tue Jan 15 08:01:02 UTC 2002


on 1/14/02 8:13 PM, John.Maloney at disney.com at John.Maloney at disney.com
wrote:

> Similar to basicAt:, clone should not be overridden so that you can always
> get the primitive clone behavior for any object. ShallowCopy might be
> overridden,
> depending on the semantics of the receiver.
> 
> Incidentally, we didn't always have a "clone" primitive. In early versions
> of Squeak, shallowCopy was written using "instVarAt:" and "instVarAt:put:".
> 
> Re: at: and basicAt:
> 
> You're right, the primitive failure code should probably be the same for both.
> 
> -- John
thanks john 

so you are suggesting that clone could be renamed basicShallowCopy. I could
send a changeset with that. This would help for consistency.

Stef




More information about the Squeak-dev mailing list