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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,32e5f5710e731d24 X-Google-Attributes: gid103376,public Path: g2news1.google.com!news2.google.com!fu-berlin.de!uni-berlin.de!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Newbie Visibility Problem TEXT_IO.INTEGER_IO Date: Thu, 03 Jun 2004 09:16:49 +0200 Organization: At home Message-ID: <2i81hfFk1nphU1@uni-berlin.de> References: Reply-To: mailbox@dmitry-kazakov.de Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Trace: news.uni-berlin.de vOf1ECxIHXZJZpPDjX5muAlwSjNlcoMl406l0GJaVqenSXU/w= User-Agent: KNode/0.7.2 Xref: g2news1.google.com comp.lang.ada:1056 Date: 2004-06-03T09:16:49+02:00 List-Id: bm34mailing wrote: > I am very new to Ada and am having a visibility problem that I am not > sure how to get around. I am trying to build the "MostUltimateAnswer" > sample application from the LAW web site (Section 1.2.12). > > http://www.scism.sbu.ac.uk/law/Section1/chap2/s1c2p12.html > > Can someone give me a hint as to the problem? I am using GNAT 3.15p and > am thinking that I am missing a library or some settings need to be > changed. At the beginning of the program, I do have the lines: > > with Ada.Text_IO; > use Ada.Text_Io; > > so I believe Text_io should be visible. It isn't. I will try to explain it. In the program you have: package IntIo is new TEXT_IO.INTEGER_IO( INTEGER ); Here Text_IO is not visible, because it is declared in the package Ada. Thus the variant (A) with Ada.Text_IO; use Ada.Text_IO; use Ada; -- This makes Text_IO visible! ... package IntIo is new TEXT_IO.INTEGER_IO( INTEGER ); You can also use the full name of Integer_IO, the following variant: (B) with Ada.Text_IO; ... package IntIo is new ADA.TEXT_IO.INTEGER_IO( INTEGER ); -- The fully qualified name Though Integer_IO is already visible as other posters noted, so the variant: (C) with Ada.Text_IO; use Ada.Text_IO; ... package IntIo is new INTEGER_IO( INTEGER ); -- Ada.Text_IO.Integer_IO is visible And finally, for backward compatibility with Ada 83, there is the package Text_IO (renamed Ada.Text_IO). Probably that misled the code author, who mixed both old and new nomenclature. So to complete the picture, in Ada 83 style: (D) with Text_IO; ... package IntIo is new TEXT_IO.INTEGER_IO( INTEGER ); -- Regards, Dmitry A. Kazakov www.dmitry-kazakov.de