[squeak-dev] #copyFrom: vs #copySameFrom:

Eliot Miranda eliot.miranda at gmail.com
Wed Sep 28 18:27:09 UTC 2011


On Wed, Sep 28, 2011 at 6:12 AM, Levente Uzonyi <leves at elte.hu> wrote:

> Hi,
>
> the two methods in the subject are for copying the values of the variables
> from one object to another. The two methods are basically the same, but
> there are slight differences:
> - #copySameFrom: doesn't use primitive 168 which provides atomic copying if
> the receiver's class is the same as the argument's class.
> - #copyFrom: doesn't copy the variables if they have the same name, but
> different indices in the two objects.
>
> So my suggestion is to merge the two features into one method: use the
> primitive and copy the variables independently of their indices. But I'm not
> sure which name should we use.
> #copyFrom: is widely used, but beginners used to expect it to work like
> #copyFrom:to: without an upper bound.
> #copySameFrom: is not widely used, but it's also less confusing for
> beginners.
> Maybe a third name would be the best choice, e.g.: #copyVariablesFrom:,
> #copySlotsFrom:, maybe #copyValuesFrom:.
> What do you think?
>

copyValuesFrom:


>
>
> Cheers,
> Levente
>
>


-- 
best,
Eliot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20110928/47a1d3e7/attachment.htm


More information about the Squeak-dev mailing list