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,1449b098788729b8 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,CP1252 Path: g2news2.google.com!postnews.google.com!s15g2000yqs.googlegroups.com!not-for-mail From: =?ISO-8859-1?Q?Yannick_Duch=EAne_Hibou57?= Newsgroups: comp.lang.ada Subject: Re: prefix of dereference must be a name? Date: Thu, 30 Jul 2009 10:36:41 -0700 (PDT) Organization: http://groups.google.com Message-ID: <3fe4b8a8-daf9-4161-84e2-ff230a2e7afd@s15g2000yqs.googlegroups.com> References: NNTP-Posting-Host: 77.198.58.209 Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1248975401 6379 127.0.0.1 (30 Jul 2009 17:36:41 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 30 Jul 2009 17:36:41 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: s15g2000yqs.googlegroups.com; posting-host=77.198.58.209; 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:7459 Date: 2009-07-30T10:36:41-07:00 List-Id: On 30 juil, 09:09, Stephen Leake wrote: > [...] > A.all :=3D (C + B).all; > > [...] > So then I tried: > [...] > A.all :=3D -(C + B).all; > > and got the same error. Finally I tried: > > [...] > A.all :=3D Copy (C + B).all; > > And the compiler was happy. > > What's the rationale for this? > > [...] > Similarly for ().all; when could that be a problem? > > -- > -- Stephe Hi Stephe, The reason behind this is in the language reference. Let's go step by step. First of all ARM 4.1.3 says: (2) selected_component ::=3D prefix . selector_name (3) selector_name ::=3D identifier | character_literal | operator_symbol No special point with =93 selector_name =94 and any way, you did not get into trouble with it. Next, is the =93 prefix =94 part which is of big interest to you. About it, ARM 4.1 says: (2) name ::=3D direct_name | explicit_dereference | indexed_component | slice | selected_component | attribute_reference | type_conversion | function_call | character_literal You may open you ARM reference or you may browse it at http://www.adaic.com/standards/05rm/html/RM-TTL.html is you haven't got one off-line on computer and then go to ARM 4.1 and follow each links to know in detail about what the =93 name =94 part can be. But you can see in the latter excerpt, that =93 function_call =94 appears, but not =93 expression =94. Now about the rationale behind (previously given, was the direct reason), I do not know, but I guess this may be to avoid any kind of invisible temporaly variable (the result of a function is mostly an initializer, not a returned variable). If I find more about the rational, I will tell you, or perhaps some one else will tell before ;) Have a nice time Yannick