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!news1.google.com!news.glorb.com!nlpi057.nbdc.sbc.com!prodigy.net!newsfeed-00.mathworks.com!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Extended return question Date: Thu, 10 Jul 2008 20:50:25 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <4875b7e3$0$6618$9b4e6d93@newsspool2.arcor-online.net> <77279091-112d-46ef-9e26-f83497a66bd5@2g2000hsn.googlegroups.com> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls6.std.com 1215737425 31993 192.74.137.71 (11 Jul 2008 00:50:25 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Fri, 11 Jul 2008 00:50:25 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:cLlUmjgqusJl4MsAAR/7u6uCK/I= Xref: g2news1.google.com comp.lang.ada:1104 Date: 2008-07-10T20:50:25-04:00 List-Id: Adam Beneschan writes: > On Jul 10, 4:20 pm, "Randy Brukardt" wrote: >> "Dale Stanbrough" wrote in message >> >> news:MrNoSpam-BCD9C2.17322110072008@news-server.bigpond.net.au... >> >> > Georg Bauhaus wrote: >> >> >> Dale Stanbrough wrote: >> >> > The purpose of an extended return is to create the values in-situ >> >> > without copying. >> >> >> _Limited_ objects can be initialized in situ by an aggregate >> >> or function call ... :-) >> >> > Ah, thanks. I had misread John Barnes comments on this. Why such a >> > restriction? Why not allow it for all extended returns on all types? >> >> Build-in-place is *allowed* for all objects; it is only *required* for types >> that always have to be limited (now known as "immutably limited types" (see >> AI05-0052-1). > > Where does the RM say that build-in-place is allowed for all objects? > The only place I can see that refers to build-in-place for nonlimited > objects is 7.6(21), and that permission seems to apply only to > controlled objects. > > Also, the language there says that if a function call is assigned into > a target object, an anonymous object doesn't need to be created if the > value of the function call can be "safely" created in the target > object. But "safely" isn't defined. If the function could create > part of the target object and then terminate on an exception, as in > Dale's original example, is that considered "unsafe", which would mean > build-in-place isn't allowed for this function call? If it doesn't > mean that, what does "safely" mean? For: X := F(...); the language rules require that X not be modified in case of exceptions in F. Of course the type of X is nonlimited here. - Bob