comp.lang.ada
 help / color / mirror / Atom feed
* how to import a package
@ 2006-12-06  2:14 markww
  2006-12-06  3:06 ` Adam Beneschan
  2006-12-06 19:47 ` Jeffrey R. Carter
  0 siblings, 2 replies; 25+ messages in thread
From: markww @ 2006-12-06  2:14 UTC (permalink / raw)


Hi,

I have this snippet of code (from members here) which defines a generic
type:

    generic
    type T is private;
        package P is
    type Node;
    type Node_Ptr is access Node;
        type Node is record
            Data     : T;
            Prev_Rec : access Node; -- points to the next record or
null if none exists.
            Next_Rec : access Node; -- points to the previous record or
null if none exists.
        end record;
    end P;

Now my compiler (gnat) complains that Node, and Node_Ptr are not seen
by the rest of the application. Is this because they are scoped within
package P?

If so, how do I 'import' the package? Right now I just stuck this at
the start of my main procedure:


procedure my_project is

    generic
    type T is private;
        package P is
    type Node;
    type Node_Ptr is access Node;
        type Node is record
            Data     : T;
            Prev_Rec : access Node; -- points to the next record or
null if none exists.
            Next_Rec : access Node; -- points to the previous record or
null if none exists.
        end record;
    end P;


    type PERSON_REC;
    type PERSON_REC_POINT is access PERSON_REC;
    type PERSON_REC is
        record
            m_strName    : UNBOUNDED_STRING;
            m_strPhone   : UNBOUNDED_STRING;
            m_strAddress : UNBOUNDED_STRING;
        end record;

so I thought it would have been visible by the rest of the application.


Thanks,
Mark 
    -- etc...




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

end of thread, other threads:[~2006-12-12 10:56 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-12-06  2:14 how to import a package markww
2006-12-06  3:06 ` Adam Beneschan
2006-12-06  3:34   ` markww
2006-12-06  9:18     ` Simon Wright
2006-12-06 19:47 ` Jeffrey R. Carter
2006-12-06 23:56   ` markww
2006-12-07  1:18     ` Björn Persson
2006-12-07  1:26     ` Brian May
2006-12-07  4:14       ` markww
2006-12-07  4:40         ` Brian May
2006-12-07  9:32           ` Stuart
2006-12-07 11:21             ` Jean-Pierre Rosen
2006-12-11  6:16               ` markww
2006-12-11  6:50                 ` markww
2006-12-11  9:40                   ` Georg Bauhaus
2006-12-11 14:19                     ` markww
2006-12-11 15:03                       ` Dmitry A. Kazakov
2006-12-11 16:22                       ` Adam Beneschan
2006-12-11 20:28                       ` Jeffrey R. Carter
2006-12-12  3:19                         ` markww
2006-12-12  3:31                           ` Jeffrey R. Carter
2006-12-12  9:03                           ` Stuart
2006-12-12 10:56                           ` Georg Bauhaus
2006-12-11  7:00                 ` Simon Wright
2006-12-07  4:06     ` Jeffrey R. Carter

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