Hi,<br><br>In squeak copy is implemented as:<br>^self shallowCopy postCopy<br><br>and deepCopy just copy 2 layers of instance, so if the object has tree like sub instance, postCopy must be implemented.<br><br>Best regards.
<br>-Liu Xinyu <br><br><div class="gmail_quote">On Jan 16, 2008 2:11 AM, Randal L. Schwartz <<a href="mailto:merlyn@stonehenge.com">merlyn@stonehenge.com</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
>>>>> "Marcin" == Marcin Tustin <<a href="mailto:mm3@zepler.net">mm3@zepler.net</a>> writes:<br><br>Marcin> So, I take it that clone is a "stupider" (no postCopy polymorphism) version
<br>Marcin> of copy (or shallowCopy). Is that right, or does it do something odd?<br><br>Object>>#clone looks like an optional-implemented primitive that<br>does a #shallowCopy, but without the fallback-to-smalltalk that #shallowCopy
<br>performs. Not sure why those are both in the image.<br><br>I'd stick with #copy unless I was the implementor of the class being<br>copied, and even then, I'd make copy "do the right thing". :)<br><font color="#888888">
<br>--<br></font><div><div></div><div class="Wj3C7c">Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095<br><<a href="mailto:merlyn@stonehenge.com">merlyn@stonehenge.com</a>> <URL:<a href="http://www.stonehenge.com/merlyn/" target="_blank">
http://www.stonehenge.com/merlyn/</a>><br>Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.<br>See <a href="http://PerlTraining.Stonehenge.com" target="_blank">PerlTraining.Stonehenge.com</a> for onsite and open-enrollment Perl training!
<br>_______________________________________________<br>Beginners mailing list<br><a href="mailto:Beginners@lists.squeakfoundation.org">Beginners@lists.squeakfoundation.org</a><br><a href="http://lists.squeakfoundation.org/mailman/listinfo/beginners" target="_blank">
http://lists.squeakfoundation.org/mailman/listinfo/beginners</a><br></div></div></blockquote></div><br>