From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fac41,15edb893ef79e231 X-Google-Attributes: gidfac41,public X-Google-Thread: f4fd2,23202754c9ce78dd X-Google-Attributes: gidf4fd2,public X-Google-Thread: 103376,15edb893ef79e231 X-Google-Attributes: gid103376,public X-Google-Thread: 114809,15edb893ef79e231 X-Google-Attributes: gid114809,public X-Google-ArrivalTime: 2002-01-20 07:15:25 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: cubicle584@mailandnews.com (Software Scavenger) Newsgroups: comp.lang.lisp,comp.lang.ada,comp.lang.eiffel,comp.lang.smalltalk Subject: Re: True faiths ( was Re: The true faith ) Date: 20 Jan 2002 07:15:25 -0800 Organization: http://groups.google.com/ Message-ID: References: <76be8851.0201101909.9db0718@posting.google.com> <9jtu3u8cq92b05j47uat3412tok6hqu1ki@4ax.com> <3C3F8689.377A9F0F@brising.com> <3219936759616091@naggum.net> <3C483CE7.D61D1BF@removeme.gst.com> <3C4863C5.6040406@mail.com> <3C48AE35.BA38ED04@adaworks.com> <3C4A58B8.10304@mail.com> NNTP-Posting-Host: 141.156.244.106 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1011539725 12253 127.0.0.1 (20 Jan 2002 15:15:25 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 20 Jan 2002 15:15:25 GMT Xref: archiver1.google.com comp.lang.lisp:24784 comp.lang.ada:19121 comp.lang.eiffel:5476 comp.lang.smalltalk:18240 Date: 2002-01-20T15:15:25+00:00 List-Id: kaz@accton.shaw.ca (Kaz Kylheku) wrote in message news:... > Suppose that you have N methods for copying an object. I do not take it > as a theorem that you can always make an (N + 1)-th method which unifies > the other N, magically choosing the appropriate one. How can this magic > meta-method possibly know what semantics the caller wants? A big part of the problem is that copy semantics are tied closely to the memory management paradigm in use. With garbage collection, it's common for an assignment statement to simply copy a pointer or reference such that the target of the assignment refers to the same object. Without garbage collection, it's much more complicated, because the target of the assignment statement has to know whether to free the object when done with it. Names such as deep copy and shallow copy do not cover the complexities, and might just add more confusion. In languages with garbage collection, the best way might be to define copy to mean shallow copy, and use other names than copy for all other copying operations. For example, to make a copy on a remote computer, you could use a name such as send. Thus we would be talking about three levels of copying: Assignment, meaning to copy the reference to make something else refer to the same object, copy, meaning to copy the object itself so it can be modified without modifying the original object, and the third level, where the copy operation would be named send or whatever name might be appropriate for the purpose of each such copy operation.