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-21 01:52:09 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!netnews.com!xfer02.netnews.com!newsfeed1.cidera.com!Cidera!cyclone1.gnilink.net!spamfinder.gnilink.net!nwrddc02.gnilink.net.POSTED!53ab2750!not-for-mail Message-ID: <3C4BE556.7040707@mail.com> From: Hyman Rosen User-Agent: Mozilla/5.0 (Windows; U; Win 9x 4.90; en-US; rv:0.9.7+) Gecko/20010929 X-Accept-Language: en-us MIME-Version: 1.0 Newsgroups: comp.lang.lisp,comp.lang.ada,comp.lang.eiffel,comp.lang.smalltalk Subject: Re: True faiths ( was Re: The true faith ) References: <%njZ7.279$iR.150960@news3.calgary.shaw.ca> <3c36fbc5_10@news.newsgroups.com> <4idg3u40ermnp682n6igc5gudp7hajkea9@4ax.com> <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> <3C4B720F.F77B2552@adaworks.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Date: Mon, 21 Jan 2002 09:52:08 GMT NNTP-Posting-Host: 162.83.247.30 X-Complaints-To: business-support@verizon.com X-Trace: nwrddc02.gnilink.net 1011606728 162.83.247.30 (Mon, 21 Jan 2002 04:52:08 EST) NNTP-Posting-Date: Mon, 21 Jan 2002 04:52:08 EST Xref: archiver1.google.com comp.lang.lisp:24833 comp.lang.ada:19131 comp.lang.eiffel:5479 comp.lang.smalltalk:18319 Date: 2002-01-21T09:52:08+00:00 List-Id: Richard Riehle wrote: > Hyman Rosen wrote: >>Richard Riehle wrote: >>> procedure Copy_Deep (Source : in T; Target : in out T); >>> procedure Copy_Shallow (Source : in T; Target : in out T); >>> >>I dislike the notion of providing these methods as external interfaces >>to a type. It seems wrong to me for a client to have to know what kind >>of copy to use - that's the type's business to know. > > Well I don't like having an assignment statement that behaves in an > unpredictable way when I use it. I think we can agree on this with unbridled enthusiasm :-) > So I prefer having the copy semantics spelled out as clearly as possible. > This clarity assures me that, when I call a method, it will behave as > I expected. But the user of a type generally isn't concerned with its innards. Why would you take a simple concept like copying or assignment and burden it with implementation details? If you were writing a sort method for a conatiner, wouldn't you just call it "sort" rather than "merge_sort' or "bubble_sort"? And if we were to say "do as Ada does", consider Unbounded_String. > As to the client needing to know which copy to use, in practice we > would make only one available, but we would make clear the semantics > of that copy. The other point is that using Ada's limited types, we > don't have to worry about making mistakes regarding the assignment > operation. Well, the normal semantics of a copy are that the source and destination are not tied to each other after the copy is made. Of course, internally that might not be true, because you could be maintaining reference counts, and doing copy-on-write. You would place all that information into the routine name? And limited types are irrelevant here. C++ and Ada can both prevent assignment from compiling. The problem was writing assignment correctly when you do want to provide it.