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: 103376,a41c4a2c795dbe34 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!e17g2000prj.googlegroups.com!not-for-mail From: Adam Beneschan Newsgroups: comp.lang.ada Subject: Re: Will "renames" increase program size? Date: Thu, 16 Jun 2011 10:42:01 -0700 (PDT) Organization: http://groups.google.com 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: 66.126.103.122 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1308246121 24314 127.0.0.1 (16 Jun 2011 17:42:01 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 16 Jun 2011 17:42:01 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: e17g2000prj.googlegroups.com; posting-host=66.126.103.122; posting-account=duW0ogkAAABjRdnxgLGXDfna0Gc6XqmQ User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-Header-Order: ARLUEHNKC X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; WOW64; Trident/4.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.21022; .NET CLR 3.5.30729; .NET CLR 3.0.30618; .NET4.0C),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:20852 Date: 2011-06-16T10:42:01-07:00 List-Id: On Jun 16, 9:33=A0am, "Dmitry A. Kazakov" wrote: > > > In this example, I believe that the renaming declaration cannot > > legally cause Adjust to be called. > > I.e. the optimization is mandated for all tagged types in presence of > return statement. Nevertheless Func creates a new object, which is then > renamed. It is not a mandated optimization, because if you follow the semantics in the RM, the example involves no *assignment* to be optimized away. I'm having difficulty responding to your points, because you seem to be defining terms with regard to how you see the world and what pictures go on in your head when you think about a program's semantics. So in this context, I can kind of understand why you'd think of a "return object" as somehow belonging inside the function and thus being a separate object from the object that holds the function result from the caller's point of view. And in this view, sure, there would be a copy. But all this is just based on how you see the world, not on anything objective. The only really objective definitions we have here are the ones given by the RM. And in the world according to the RM, there is only one object (the return object, which has multiple different "views" that are given different names, but is still only one object and thus there's no copying going on). I can understand why you might look at things differently; but it's hard for me to see how any conclusions that you draw, that are based on your own meanings of the terms derived from your own pictures of the world, are going to be of much use to anyone else. -- Adam