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=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,910a48a538936849 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news1.google.com!newsfeed.gamma.ru!Gamma.RU!news2.volia.net!newsfeed01.sul.t-online.de!t-online.de!newsfeed.arcor.de!newsspool4.arcor-online.net!news.arcor.de.POSTED!not-for-mail Newsgroups: comp.lang.ada Subject: Re: how to import a package From: Georg Bauhaus In-Reply-To: <1165819804.449958.305980@73g2000cwn.googlegroups.com> References: <1165371252.358817.57840@80g2000cwy.googlegroups.com> <4577dc92$1_1@glkas0286.greenlnk.net> <7ft8le.vk1.ln@hunter.axlog.fr> <1165817760.736164.218530@73g2000cwn.googlegroups.com> <1165819804.449958.305980@73g2000cwn.googlegroups.com> Content-Type: text/plain Content-Transfer-Encoding: 7bit Organization: # Message-ID: <1165830005.15844.5.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.6.1 Date: Mon, 11 Dec 2006 10:40:06 +0100 NNTP-Posting-Date: 11 Dec 2006 10:39:22 CET NNTP-Posting-Host: 206fa7dc.newsspool4.arcor-online.net X-Trace: DXC=2J8TUI_V^l]E47KDAk81NW4IUK On Sun, 2006-12-10 at 22:50 -0800, markww wrote: > So I made a test function like: > > procedure Add_Record(GenericData : gNode.T) is > Temp : gNode.Node_Ptr; > begin > Temp := new gNode.Node; > Temp.Data := GenericData; > end Add_Record; > > now the compiler is saying that my generic type T is not visible to the > rest of the application. The type T is in the formal part of the package, not in the package proper. So either you are explicit about T (you have made an instance of the package using Some_Type for T, so you can use Some_Type instead of gNode.T there, too) or you make your generic package have a type Gen_T by using "subtype Gen_T is T" or similar. > Also, is this procedure definition correct? In C++ it's easy to do this > after defining a type it would be just: > > bool Add_Record (T t); > template > bool CLinkedList::Add_Record(T t) > { > // ... > } But here, you have one specific T and one generic T.