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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,f857f366542cd8aa X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,CP1252 Path: g2news2.google.com!postnews.google.com!d32g2000yqh.googlegroups.com!not-for-mail From: =?ISO-8859-1?Q?Hibou57_=28Yannick_Duch=EAne=29?= Newsgroups: comp.lang.ada Subject: Re: Dispatch on the result still does not work? Date: Sat, 11 Jul 2009 11:08:55 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <3a2a94a3-91df-411e-b078-498cc7850554@18g2000yqa.googlegroups.com> <7tu7wng4vxn6.nhbegffx941o$.dlg@40tude.net> NNTP-Posting-Host: 77.198.58.77 Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1247335736 32639 127.0.0.1 (11 Jul 2009 18:08:56 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sat, 11 Jul 2009 18:08:56 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: d32g2000yqh.googlegroups.com; posting-host=77.198.58.77; posting-account=vrfdLAoAAAAauX_3XwyXEwXCWN3A1l8D User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; fr),gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:6993 Date: 2009-07-11T11:08:55-07:00 List-Id: On 11 juil, 17:19, "Dmitry A. Kazakov" wrote: > Well, I used to think the way like you do until Ada 2005 introduced limit= ed > aggregates and initialization of limited objects and their components usi= ng > functions... (:-)) This does not stand for the general case of a function. This is a specific requirement, which may in some way be compared to the previoulsy given implementation optimization exemple. The difference here, is that this is not an implementation optimization, but a =93 low level =94 semantic requirement like the support for controling initialization/adjustement of objects... the kind of aspect which tipically reside in the private part of a package specification ;-) . This is a special subset of what a function may-be, which is not the same as the general case of a function. Any way, this still handled separately, this is something standing around the function, this is not the function. The extended return statement is still a return statement, which may be used in any others functions... which finally makes it rather conform to what a function is in its general case. BTW: Yes, you're right about the value vs the object (I did not get the good word) Annotated ARM 7.5 - =93 Limited Types =94 > 8.1/2 {AI95-00287-01} {AI95-00318-02} For an aggregate of a limited > type used to initialize an object as allowed above, the > implementation shall not create a separate anonymous object for the > aggregate. For a function_call of a type with a part that is of a > task, protected, or explicitly limited record type that is used to > initialize an object as allowed above, the implementation shall not > create a separate return object (see 6.5) for the function_call. The > aggregate or function_call shall be constructed directly in the new > object. > - > 8.a/2Discussion: {AI95-00318-02} For a function_call, we only > require build-in-place{build-in-place [partial]} for a limited type > that would have been a return-by-reference type in Ada 95. We do > this because we want to minimize disruption to Ada 95 > implementations and users. > - > NOTES > 9/214 {AI95-00287-01} {AI95-00318-02} While it is allowed to write > initializations of limited objects, such initializations never copy > a limited object. The source of such an assignment operation must be > an aggregate or function_call, and such aggregates and > function_calls must be built directly in the target object. The > following are consequences of the rules for limited types: Yes, but how would you initialize a limited type another way, while it cannot be assigned by copy ? This is a mandatory semantic requirement. But the function still acts as an initializer expression in the user's view point. Annotated ARM 7.5 (again) > 2.e/2 Discussion: All of these contexts normally require copying; by > restricting the uses as above, we can require the new object to be > built-in-place. > - > [...] > - > 9/214 {AI95-00287-01} {AI95-00318-02} While it is allowed to write > initializations of limited objects, such initializations never copy > a limited object. The source of such an assignment operation must be > an aggregate or function_call, and such aggregates and > function_calls must be built directly in the target object. The > following are consequences of the rules for limited types: The requirement is well based