comp.lang.ada
 help / color / mirror / Atom feed
* premature use
@ 2002-05-05 15:03 Preben Randhol
  2002-05-05 18:20 ` Jim Rogers
  2002-05-06 14:06 ` Stephen Leake
  0 siblings, 2 replies; 4+ messages in thread
From: Preben Randhol @ 2002-05-05 15:03 UTC (permalink / raw)



When I try to make the package as below I get from GNAT the error:

   premature use of private type

I understand this is correct, but is it possible to make this package in
a way that makes the Help_File_Type and Help_Index_Type private while
keeping File_List and Index_List public?

Thanks in advance.

Preben
--------------------------------------------------------------------
with Double_Linked_List;
with Ada.Strings.UnBounded;   use Ada.Strings.UnBounded;

pragma Elaborate_All (Double_Linked_List);

package Help_Lists is

   type Help_File_Type is private;
   type Help_Index_Type is private;

   package File_List is
      new Double_Linked_List (Data_Type => Help_File_Type);

   package Index_List is
      new Double_Linked_List (Data_Type => Help_Index_Type);

private
   type Help_File_Type is
      record
         Topic : Unbounded_String;
         Text  : Unbounded_String;
      end record;

   type Help_Index_Type is
      record
         Section : Unbounded_String;
         List    : File_List.List_Type;
      end record;

   Help_List : Index_List.List_Type := Index_List.New_List;

end Help_Lists;
---------------------------------------------------------------------



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

end of thread, other threads:[~2002-05-06 14:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-05-05 15:03 premature use Preben Randhol
2002-05-05 18:20 ` Jim Rogers
2002-05-06  9:20   ` Preben Randhol
2002-05-06 14:06 ` Stephen Leake

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