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,&nbsp; 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 &lt;<a href="mailto:merlyn@stonehenge.com">merlyn@stonehenge.com</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
&gt;&gt;&gt;&gt;&gt; &quot;Marcin&quot; == Marcin Tustin &lt;<a href="mailto:mm3@zepler.net">mm3@zepler.net</a>&gt; writes:<br><br>Marcin&gt; So, I take it that clone is a &quot;stupider&quot; (no postCopy polymorphism) version
<br>Marcin&gt; of copy (or shallowCopy). Is that right, or does it do something odd?<br><br>Object&gt;&gt;#clone looks like an optional-implemented primitive that<br>does a #shallowCopy, but without the fallback-to-smalltalk that #shallowCopy
<br>performs. &nbsp;Not sure why those are both in the image.<br><br>I&#39;d stick with #copy unless I was the implementor of the class being<br>copied, and even then, I&#39;d make copy &quot;do the right thing&quot;. :)<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>&lt;<a href="mailto:merlyn@stonehenge.com">merlyn@stonehenge.com</a>&gt; &lt;URL:<a href="http://www.stonehenge.com/merlyn/" target="_blank">
http://www.stonehenge.com/merlyn/</a>&gt;<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>