[Newbies] Object clone

Marcin Tustin mm3 at zepler.net
Tue Jan 15 18:01:51 UTC 2008


So, I take it that clone is a "stupider" (no postCopy polymorphism) version
of copy (or shallowCopy). Is that right, or does it do something odd?

On Jan 15, 2008 5:38 PM, Randal L. Schwartz <merlyn at stonehenge.com> wrote:

> >>>>> "Jakub" == Jakub  <seasidebeginner at gmail.com> writes:
>
> Jakub> yeah a, b instance of same class and i want copy all instance
> variables
> Jakub> values to a i want do a := b but i dont want to a is same object as
> b. In
> Jakub> memory will be two objects a, b with same values .. but if i change
> a i dont
> Jakub> change b.
>
> b := a copy.
>
> but you might also want to look at #deepCopy.
>
> --
> Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777
> 0095
> <merlyn at stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
> Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
> See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl
> training!
> _______________________________________________
> Beginners mailing list
> Beginners at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/mailman/listinfo/beginners
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/beginners/attachments/20080115/56e493f6/attachment.htm


More information about the Beginners mailing list