comp.lang.ada
 help / color / mirror / Atom feed
* Combining packages
@ 2001-10-31 18:15 Preben Randhol
  2001-10-31 18:31 ` Matthew Heaney
  0 siblings, 1 reply; 5+ messages in thread
From: Preben Randhol @ 2001-10-31 18:15 UTC (permalink / raw)


Hi

I have made a generic package called Double_Linked_List. I have also a
package called Wordgroups which has the type Wordgroup and several
functions/procedures connected with the type.

Now I want to have a List of Wordgroups. 

First I made a child package Wordgroups.List of the Wordgroups pacakge
like this:

with Double_Linked_List;
with Wordgroups;

   package Wordgroups.List is
         new Double_Linked_List (Data_Type => Wordgroups.Wordgroup_Type);


Now I relized that it would be nice to have a procedure like:

   procedure Add (List        : in out  List_Type;
                  Word        : in      String;
                  Explanation : in      String) is

      Wordgroup : Wordgroup_Type;

   begin
      Create (Wordgroup, Word, Explanation);
      Append_Element (List, Wordgroup);
   end Add;

so that I don't have to do:

   Create (Wordgroup, Word, Explanation);
   Append_Element (List, Wordgroup);

in the rest of the program, only Add.

But I cannot add this to Wordgroups.List.

I would appreciate some hints on how to do something like this. Thanks
in advance.

Preben Randhol
-- 
�.., chaos is found in greatest abundance wherever order is being
sought. It always defeats order, because it is better organized.�
                            -- Interesting Times, Terry Pratchett



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2001-10-31 20:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-10-31 18:15 Combining packages Preben Randhol
2001-10-31 18:31 ` Matthew Heaney
2001-10-31 20:27   ` Preben Randhol
2001-10-31 20:41     ` Matthew Heaney
2001-10-31 20:40       ` Preben Randhol

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox