From: Charles Hixson Date: 2000-06-19T17:57:43+00:00 Subject: [ruby-talk:03528] Re: Deep copy? This is a multi-part message in MIME format. --------------155C8091ED070A89F870AC19 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit GOTO Kentaro wrote: > ... snip ... > A serious problem is the meaning of copy. More precisely, we don't > have a consensus to what an object is,i.e. the state of an object. For > example, the behavior of an IO object in the future is undecidable, so > ... snip ... > -- gotoken The smalltalk approach quoted above suggests a method around this. Implement a (nearly) vacuous method in Object, and name it DeepCopy (the default for Object could be the same as the shallow copy). Then it is the responsibility of every descendant that wishes DeepCopy to be implemented to do the implementation. Of course numeric methods would have a clear and obvious method of doing a DeepCopy, but as it isn't generally needed, many of the classes could just leave this to be implemented by a descendant. --------------155C8091ED070A89F870AC19 Content-Type: text/x-vcard; charset=us-ascii; name="charleshixsn.vcf" Content-Transfer-Encoding: 7bit Content-Description: Card for Charles Hixson Content-Disposition: attachment; filename="charleshixsn.vcf" begin:vcard n:Hixson;Charles x-mozilla-html:FALSE adr:;;;;;; version:2.1 email;internet:charleshixson@earthling.net fn:Charles Hixson end:vcard --------------155C8091ED070A89F870AC19--