Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Ada > using put proce...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 5 Topic 5688 of 5697
Post > Topic >>

using put procedure with a generic package

by "ophir.geffen@[EMAIL PROTECTED] " <ophir.geffen@[EMAIL PROTECTED] > May 7, 2008 at 08:27 PM

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




 5 Posts in Topic:
using put procedure with a generic package
"ophir.geffen@[EMAIL  2008-05-07 20:27:19 
Re: using put procedure with a generic package
"Jeffrey R. Carter&q  2008-05-08 04:09:25 
Re: using put procedure with a generic package
"ophir.geffen@[EMAIL  2008-05-07 21:48:47 
Re: using put procedure with a generic package
"Dmitry A. Kazakov&q  2008-05-08 09:24:53 
Re: using put procedure with a generic package
Adam Beneschan <adam@[  2008-05-08 08:54:56 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed May 14 13:01:59 CDT 2008.