From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,910a48a538936849,start X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!80g2000cwy.googlegroups.com!not-for-mail From: "markww" Newsgroups: comp.lang.ada Subject: how to import a package Date: 5 Dec 2006 18:14:12 -0800 Organization: http://groups.google.com Message-ID: <1165371252.358817.57840@80g2000cwy.googlegroups.com> NNTP-Posting-Host: 66.65.64.109 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1165371286 10986 127.0.0.1 (6 Dec 2006 02:14:46 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 6 Dec 2006 02:14:46 +0000 (UTC) User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727),gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: 80g2000cwy.googlegroups.com; posting-host=66.65.64.109; posting-account=cNKOMg0AAADT2ug8oGSYYXo8bsDvrHzw Xref: g2news2.google.com comp.lang.ada:7816 Date: 2006-12-05T18:14:12-08:00 List-Id: 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...