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-Thread: 103376,9a1fb7a9d3453036 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!news.germany.com!newsfeed.utanet.at!newsfeed01.chello.at!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: generic package, can't find an error Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <1178977817.583151.234370@q75g2000hsh.googlegroups.com> Date: Sat, 12 May 2007 17:15:33 +0200 Message-ID: <18caklz18c8xt.3lri19x37kp2.dlg@40tude.net> NNTP-Posting-Date: 12 May 2007 17:15:21 CEST NNTP-Posting-Host: 375ac187.newsspool1.arcor-online.net X-Trace: DXC=\BH3YBWG30a1gD7 On 12 May 2007 06:50:17 -0700, pilarp@poczta.onet.pl wrote: > I wrote a small program using a generic package, one of its functions > (the one posted below, named read_file_text) was supposed to get some > elements from a text file and write them on a standard output. In the > test program the package was instantiated with float type. The > remaining procedures and functions work properly, so I excluded them > from the source code of my program which you can see below. The source > code is included in 3 separate files: arrays.ads (package > specification), arrays.adb (package body) and test_arrays.adb (test > program using the package). While I compile arrays.ads and arrays.adb > succesfully, I get the following compiler error when I try to compile > test_arrays.adb: > > "No visible program matches the specification for "Get" ". Please look > at the code and tell me what is wrong. > > arrays.ads: > > with Ada.Text_Io; > use ada.text_io; > generic > type element is private; > with procedure get(f:in file_type; o: out element) is <>; See the declaration of Get in Ada.Text_IO.Float_IO (of which instance Ada.Float_Text_IO is). It is (RM A.10.9(7)): procedure Get(File : in File_Type; Item : out Num; Width : in Field := 0); So there is a third parameter you have to add to your formal procedure. --------------- P.S. John P Woodruff did what you are probably looking for. See http://www.dmitry-kazakov.de/ada/Numeric-Name-IO.htm -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de