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, WEIRD_PORT autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,7a5b8336407bf471 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-11-09 02:36:24 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: gautier_niouzes@hotmail.com (Gautier) Newsgroups: comp.lang.ada Subject: Re: Safe "use" directive Date: 9 Nov 2002 02:36:24 -0800 Organization: http://groups.google.com/ Message-ID: <17cd177c.0211090236.3861733a@posting.google.com> References: <3dcba716$0$305$bed64819@news.gradwell.net> NNTP-Posting-Host: 80.218.95.120 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1036838184 30677 127.0.0.1 (9 Nov 2002 10:36:24 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 9 Nov 2002 10:36:24 GMT Xref: archiver1.google.com comp.lang.ada:30630 Date: 2002-11-09T10:36:24+00:00 List-Id: Victor Porton: ... > This avoids the danger of initentedly "use"ing a subrountine from > one package working on a type from an other package instead of > assumed the-same-named subrountine from the second package. Too complicated, I think. The solution is to "use" both packages, the compiler must then detect ambiguities: with Text_IO; use Text_IO; with Dual_IO; use Dual_IO; procedure Test_Use is begin New_Line; end Test_Use; * ObjectAda: test_use.adb: Error: line 6 col 3 LRM:8.6(31), Ambiguous call, possible definitions of New_Line appear at line 92 of file ada.text_io.spc, line 58 of file dual_io.ads. * GNAT: test_use.adb:6:03: ambiguous expression (cannot resolve "New_Line") test_use.adb:6:03: possible interpretation at dual_io.ads:58 test_use.adb:6:03: possible interpretation at a-textio.ads:169 ________________________________________________________ Gautier -- http://www.mysunrise.ch/users/gdm/gsoft.htm NB: For a direct answer, address on the Web site!