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,57f8540942f8e060 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!postnews.google.com!h12g2000yql.googlegroups.com!not-for-mail From: =?ISO-8859-1?Q?Hibou57_=28Yannick_Duch=EAne=29?= Newsgroups: comp.lang.ada Subject: Re: Initialization and Finalization of limited object "returned" by a function Date: Thu, 11 Feb 2010 15:15:08 -0800 (PST) Organization: http://groups.google.com Message-ID: <8e09c20d-172e-42a2-b2ff-994863893523@h12g2000yql.googlegroups.com> References: <41b794ec-26b0-485e-a959-580a5b877a3b@f15g2000yqe.googlegroups.com> NNTP-Posting-Host: 77.198.58.225 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1265930108 4000 127.0.0.1 (11 Feb 2010 23:15:08 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 11 Feb 2010 23:15:08 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: h12g2000yql.googlegroups.com; posting-host=77.198.58.225; 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: g2news1.google.com comp.lang.ada:9124 Date: 2010-02-11T15:15:08-08:00 List-Id: On 11 f=E9v, 12:00, Ludovic Brenta wrote: > Yannick Duch=EAne wrote on comp.lang.ada: > > > =A0 =A0Tested_Interface : Dispatch.Instance_Class :=3D > > =A0 =A0 =A0(Dispatch.New_Instance); > > Here you are initializing with an aggregate that contains the result > of the function call. I suspect this triggers a compiler bug. What > happens if you remove the parentheses? As Jean-Pierre explained, this is not an aggregate, its a parenthesized expression. Let me explain why such a simple expression is parenthesized here : this is just a matter of text layout. I follow one part of the convention which is in use in the world of GNAT/GPS, which applies an outdent of one character whenever a language construct which is able to start with a parenthesis span multiple lines. This make sens for a complex expression or an enumeration spanning multiple lines as an example (in the latter example, the first parenthesis being outdent of one character, the first item which comes next to it, has thus the same indent as all the following items). But as this outdent is always to be there, if the construct is not parenthesized, then the indentation is not the expected one. So, when it happens a simple expression has to stand to the next line, indented, just because it would have otherwise go beyond the line width limit (which is 67 characters when I post example source on c.l.a), it turns to be a simple expression with parenthesis. That's true that a lot of parenthesized constructs of the Ada language may seems ambiguous at first sight. But these potential ambiguities are gracefully handled by some language rules intended for adjustment and ambiguity removal, so that it is finally not ambiguous at all.