> Hi,
>>> 
>>> I found the clone primitive method in the Object class.
>>> Its behavior looks the same as shallowCopy. Actually, shallowCopy just
>>> sends basicShallowCopy wich calls the same primitive as clone
>>> (primitive 148).
>>> 
>> 
>> I wonder what image do you use. In a standard image #clone is primitive
>> only, while #shallowCopy tries to copy the object if the primitive fails.
>> #basicShallowCopy doesn't exist.
>> 
> 
> I am using #clone, to be 100% sure that i cloning object primitively,
> without additional logic, which #shallowCopy may introduce.


shallowCopy should not overriden this is postCopy that should. 
how can you be sure that clone is not overriden?
I have the same code for shallowCopy and clone and it would make sense
to remove one and may to add that this methods should not be overridden (except 
by system classes)

Stef
_______________________________________________
Pharo-project mailing list
[email protected]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

Reply via email to