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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,a41c4a2c795dbe34 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!feeder.news-service.com!newsfeed.straub-nv.de!nuzba.szn.dk!news.jacob-sparre.dk!pnx.dk!jacob-sparre.dk!ada-dk.org!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Will "renames" increase program size? Date: Thu, 16 Jun 2011 18:39:35 -0500 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: <46294109-f07d-49c0-8e81-65a369a05ced@z15g2000prn.googlegroups.com> <1ayjsy885qg2b$.13bmeo97hbau1$.dlg@40tude.net> <316ac8ed-1ded-43d0-98d1-36bb2c0221ad@f2g2000yqh.googlegroups.com> <2e8222df-9b82-497f-9dc4-5cb0d5653550@f31g2000pri.googlegroups.com> <1t5j5p8gurul3$.k4cq2qnsbbjb.dlg@40tude.net> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: munin.nbi.dk 1308267578 12884 69.95.181.76 (16 Jun 2011 23:39:38 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Thu, 16 Jun 2011 23:39:38 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6090 Xref: g2news2.google.com comp.lang.ada:20868 Date: 2011-06-16T18:39:35-05:00 List-Id: "Dmitry A. Kazakov" wrote in message news:welpqz29i316$.10qazzjvlklcp$.dlg@40tude.net... ... > It would be useless to discuss Ada's concept of renaming (or function > result, or anything else) in the terms of the RM, because in this context > it neither right or wrong, it just is as it is. Not at all. We spend hundreds of hours a year talking about things like renames in terms of the RM. Moreover, when you are using terminology defined by the RM (like "copy", "renames", "return object", "temporary object"), it's likely that people (especially Adam and I) will think you are talking in those terms. And a renaming (in RM terms) is never a copy. If you're going to use RM-defined concepts and ignore the RM definition, then you ought to clearly say so so that there is less confusion. And you're seriously confused on how these things work. >Semantically returning result of a function is always copying because the >object being returned changes the scope. "Changing scope" doesn't require a copy in either RM or some sort of outside logical universe. The only thing that the "scope" of an object controls is when it is finalized, and that has nothing to do with the contents (from a logical perspective) of the object. (If the implementation uses some pointers or something for this purpose, that is merely an implementation detail and has no effect on the logical properties.) Ada indeed requires that this be a single object (so that 'Access works). In further cases, Ada requires that the anonymous object "mutate" into the target object with no copying ("built-in-place"); this too changes scope. The point is that copying has a visible semantic effect, and implementations cannot just copy things whenever they feel like it -- its only allowed in certain cases. In Ada 95 and 2005, this was supposedly an optimization, but that model simply does not work and has been abandoned in favor of requirements to not copy. (That was years ago, with a binding interpretation AI05-0067-1.) There is still a permission to not copy in some other cases. Randy.