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=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.224.97.1 with SMTP id j1mr7565357qan.6.1380046535973; Tue, 24 Sep 2013 11:15:35 -0700 (PDT) X-Received: by 10.182.72.131 with SMTP id d3mr67290obv.39.1380046535940; Tue, 24 Sep 2013 11:15:35 -0700 (PDT) Path: border1.nntp.ams3.giganews.com!border2.nntp.ams3.giganews.com!border2.nntp.ams2.giganews.com!border4.nntp.ams.giganews.com!border2.nntp.ams.giganews.com!nntp.giganews.com!weretis.net!feeder1.news.weretis.net!feeder4.news.weretis.net!news.glorb.com!d5no1772592qap.0!news-out.google.com!9ni111qaf.0!nntp.google.com!d5no1772586qap.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Tue, 24 Sep 2013 11:15:35 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=129.59.203.113; posting-account=7Oy7OQoAAABhVYFOo553Cn1-AaU-bSfl NNTP-Posting-Host: 129.59.203.113 References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <9afe7143-873f-4ae9-a387-424a9f858827@googlegroups.com> Subject: Re: Ambiguous expressions - Help! From: Eryndlia Mavourneen Injection-Date: Tue, 24 Sep 2013 18:15:35 +0000 Content-Type: text/plain; charset=ISO-8859-1 X-Original-Bytes: 2535 Xref: number.nntp.dca.giganews.com comp.lang.ada:183439 Date: 2013-09-24T11:15:35-07:00 List-Id: On Tuesday, September 24, 2013 12:38:34 PM UTC-5, Mike H wrote: > package Foo1 is > type grid_index_type is new integer range 0..80; > type grid_type is array (grid_index_type range <>) of character; > subtype Vector_type is grid_type (0 .. 8); > ... etc. > > with Foo1; > package Foo2 is > procedure Put_line (Item : in Foo1.Vector_type); > procedure Put_line (Item : in string); > ... etc. > > with Foo1; use Foo1; > with Foo2; > procedure Foo3 is > Foo_thing : Vector_type; > begin > ... etc. > Foo2.Put_line (Foo_thing); > ... etc. > Foo2.Put_line ("Something else"); > ... etc. > end Foo3; > > Compilation of Foo3 raises error messages of the form "ambiguous > expression (cannot resolve "Put_line") > > I find it hard to believe that the compiler cannot distinguish between a > string and an array of characters. What am I doing wrong? > -- > Mike An Ada String *is* an array of characters. I didn't realize it, but apparently the String constant (in quotes) can be converted automatically into any vector of characters, even those not declared explicitly as "String"s. --Eryndlia (KK1T)