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,1540032852ee6d61 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!p10g2000cwp.googlegroups.com!not-for-mail From: "Adam Beneschan" Newsgroups: comp.lang.ada Subject: Re: Why does this work? (overloads) Date: 7 Feb 2007 11:21:23 -0800 Organization: http://groups.google.com Message-ID: <1170876083.353327.155370@p10g2000cwp.googlegroups.com> References: <1170823163.681564.186260@s48g2000cws.googlegroups.com> NNTP-Posting-Host: 66.126.103.122 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1170876089 14840 127.0.0.1 (7 Feb 2007 19:21:29 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 7 Feb 2007 19:21:29 +0000 (UTC) In-Reply-To: User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.12) Gecko/20050922 Fedora/1.7.12-1.3.1,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: p10g2000cwp.googlegroups.com; posting-host=66.126.103.122; posting-account=cw1zeQwAAABOY2vF_g6V_9cdsyY_wV9w Xref: g2news2.google.com comp.lang.ada:9089 Date: 2007-02-07T11:21:23-08:00 List-Id: On Feb 7, 11:02 am, "Jeffrey R. Carter" wrote: > You should be able to say > > V := T'(F) (5); > > to indicate a call to F1, but GNAT complains, saying a binary operator > is expected between ')' and '('. This seems to be a compiler error. > T'(F) should be a value of type T, which can then be indexed. After all, > you can say > > X : constant T := T'(F); > > V : Integer := X (5); No, the compiler is right. The problem here is that the syntax of Ada says that an index can be applied to a "name", but a qualified expression is not a "name". I griped about this in AI05-0003. See http://www.ada-auth.org/cgi-bin/cvsweb.cgi/AI05s/AI05-0003-1.TXT? rev=1.1 -- Adam