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,f8a440310f7f2e02 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!34g2000hsf.googlegroups.com!not-for-mail From: Adam Beneschan Newsgroups: comp.lang.ada Subject: Re: Extended return question Date: Thu, 10 Jul 2008 08:19:41 -0700 (PDT) Organization: http://groups.google.com Message-ID: <69940bd4-74f7-4b00-93d6-482c7394fcef@34g2000hsf.googlegroups.com> References: NNTP-Posting-Host: 66.126.103.122 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1215703181 17088 127.0.0.1 (10 Jul 2008 15:19:41 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 10 Jul 2008 15:19:41 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: 34g2000hsf.googlegroups.com; posting-host=66.126.103.122; posting-account=duW0ogkAAABjRdnxgLGXDfna0Gc6XqmQ User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.12) Gecko/20050922 Fedora/1.7.12-1.3.1,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:1084 Date: 2008-07-10T08:19:41-07:00 List-Id: On Jul 10, 7:37 am, Robert A Duff wrote: > Dale Stanbrough writes: > > The purpose of an extended return is to create the values in-situ > > without copying. > > No, that's not correct. Limited function results are built in place, > nonlimited ones are not. It's got nothing to do with which sort of > return statement you use -- limited builds in place even when you > say "return ;". Actually, the situation with limited types isn't totally clear, either. However, for limited types, there's no way Dale could test this using the sort of example he used above, since he used his Extended_Return_Function on the right-hand side of an assignment, which wouldn't be allowed for a function returning a limited type. If he tried to use the function call as an initializer for some object X, and the function raised an exception and left, there's no way X could be examined to determine whether some of the components of X were set. But in AI05-67, I did come up with an example where an extended return with a limited function result was left with a GOTO, and the function then did another extended return, and I had a question about whether the components set up by the first extended return (if not overwritten by the second) were required to show up in the result. Your answer, Bob, was "no", and I think that if AI05-67 is adopted, the answer will still be "no", because this AI says that the function result object does not "morph" into the created object until the return is completed. The upshot of this AI is, I think, that (1) the object being worked on for an extended return is *not* an "alias" for the object being created, even for a limited type, and (2) although limited types aren't supposed to be copied, this is true only in an Ada semantic sense, and implementations are allowed to do any block- copies they wish as long as they get the Ada semantics right. -- Adam