comp.lang.ada
 help / color / mirror / Atom feed
From: "markww" <markww@gmail.com>
Subject: how to import a package
Date: 5 Dec 2006 18:14:12 -0800
Date: 2006-12-05T18:14:12-08:00	[thread overview]
Message-ID: <1165371252.358817.57840@80g2000cwy.googlegroups.com> (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...




             reply	other threads:[~2006-12-06  2:14 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-06  2:14 markww [this message]
2006-12-06  3:06 ` how to import a package 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
replies disabled

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