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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no 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!feeder1.cambriumusenet.nl!feed.tweaknews.nl!193.201.147.68.MISMATCH!feeder.news-service.com!94.75.214.39.MISMATCH!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Will "renames" increase program size? Date: Fri, 17 Jun 2011 08:53:21 +0200 Organization: cbb software GmbH Message-ID: <12lr1j2mmzidu.18gjo4p3e73kk$.dlg@40tude.net> 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> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: Viuz/NoseYxxVso8mLhvQQ.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Xref: g2news2.google.com comp.lang.ada:20878 Date: 2011-06-17T08:53:21+02:00 List-Id: On Thu, 16 Jun 2011 18:39:35 -0500, Randy Brukardt wrote: >>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. I fail to see how finalization could have nothing to do with the contents. Finalized objects have no contents, they do not even exist. > In further cases, Ada > requires that the anonymous object "mutate" into the target object with no > copying ("built-in-place"); this too changes scope. Yep, "mutating", that is the term of the RM, I should have used instead of "copying"! (:-)) So, the correct statement should have been: when the result of a function is renamed it *mutates* into the target of renaming. Hmm, what is the RM term for a non-existent thing? (And some functions do not "return", they "build"!) > The point is that copying has a visible semantic effect, The cases under consideration are ones where copying should have no semantic effect, e.g. parameter passing. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de