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: a07f3367d7,1449b098788729b8,start X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news1.google.com!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post02.iad.highwinds-media.com!news.flashnewsgroups.com-b7.4zTQh5tI3A!not-for-mail Newsgroups: comp.lang.ada Subject: prefix of dereference must be a name? From: Stephen Leake Date: Thu, 30 Jul 2009 03:09:31 -0400 Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (windows-nt) Cancel-Lock: sha1:cr0StcHjHac7e76XHHq6KO+uoKM= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@flashnewsgroups.com Organization: FlashNewsgroups.com X-Trace: 1bbfc4a714735e197caa704235 Xref: g2news2.google.com comp.lang.ada:7438 Date: 2009-07-30T03:09:31-04:00 List-Id: I'd like to be able to do the following: type T is record ... end record; type T_Access is access all T; function "+" (Left, Right in : ...) return T_Access; A : T_Access := new T; B : T_Access := new T; C : T_Access := A + B; A.all := (C + B).all; but GNAT complains that "prefix for selection is not a name", pointing to (C + B).all. So then I tried: function "-" (Token : in T_Access) return T_Access is begin return Token; end; A.all := -(C + B).all; and got the same error. Finally I tried: function Copy (Token : in T_Access) return T_Access is begin return Token; end; A.all := Copy (C + B).all; And the compiler was happy. What's the rationale for this? I assume one issue here is that "-" might be an intrinsic, but since the type involved is not a numeric type, I don't see how that could be a problem. Similarly for ().all; when could that be a problem? -- -- Stephe