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.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,ffef1fd08e45df0c,start X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!r66g2000hsg.googlegroups.com!not-for-mail From: "ophir.geffen@gmail.com" Newsgroups: comp.lang.ada Subject: using put procedure with a generic package Date: Wed, 7 May 2008 20:27:19 -0700 (PDT) Organization: http://groups.google.com Message-ID: <151bc418-a6e4-47ef-ab7f-5b93a3cedb58@r66g2000hsg.googlegroups.com> NNTP-Posting-Host: 84.228.83.197 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1210217239 13131 127.0.0.1 (8 May 2008 03:27:19 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 8 May 2008 03:27:19 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: r66g2000hsg.googlegroups.com; posting-host=84.228.83.197; posting-account=lm8QOAoAAABTtES85uhrtpkmFliOTt7J User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.1.14) Gecko/20080410 SUSE/2.0.0.14-0.1 Firefox/2.0.0.14,gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:5745 Date: 2008-05-07T20:27:19-07:00 List-Id: Hi I'm trying to write a generic queue package with a Put procedure in it like this... * queues.ads: with Ada.Text_IO; generic type Item is private; with procedure Item_Put(The_Item : in Item); package Queues is type Queue is private; ... procedure Put(The_Item : in Item); --- this uses Item_Put ... end Queues; * and use it in test_queues.adb: with Ada.Text_IO, Queues; use Ada.Text_IO; procedure Test_Queues is package Int_IO is new Ada.Text_IO.Integer_IO(Integer); package Int_Queues is new Queues(Item => Integer, Item_Put => Int_IO.Put); --- error here ... end Test_Queues; The package compiles on its own, but when I try to compile Test_Queues there is an error: no visible subprogram matches the specification for "Item_Put" What is the problem and how can I solve it? The package worked when it was a non generic package and I had Item defined as a private subtype. Btw, I use Ada 95 with gnat. Thanks in advance