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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,6e00ae5009f6fb00 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed00.sul.t-online.de!t-online.de!frankfurt1.telia.de!news-stoc.telia.net!news-stoa.telia.net!telia.net!masternews.telia.net.!newsb.telia.net.POSTED!not-for-mail From: =?ISO-8859-1?Q?Bj=F6rn_Persson?= User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4.1) Gecko/20031114 X-Accept-Language: sv, sv-se, sv-fi, en-gb, en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: questions to generic References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Message-ID: Date: Wed, 29 Sep 2004 14:50:11 GMT NNTP-Posting-Host: 217.209.116.179 X-Complaints-To: abuse@telia.com X-Trace: newsb.telia.net 1096469411 217.209.116.179 (Wed, 29 Sep 2004 16:50:11 CEST) NNTP-Posting-Date: Wed, 29 Sep 2004 16:50:11 CEST Organization: Telia Internet Xref: g2news1.google.com comp.lang.ada:4386 Date: 2004-09-29T14:50:11+00:00 List-Id: Rick Santa-Cruz wrote: > And how and where do I have to instantiate the procedure then? For example: procedure Gen_Test_Client is generic type Element is private; procedure Gen_Proc(El: Element); procedure Gen_Proc(El: Element) is begin null; end Gen_Proc; procedure Natural_Proc is new Gen_Proc(Natural); procedure Character_Proc is new Gen_Proc(Character); begin -- Gen_Test_Client Natural_Proc(5); Character_Proc('X'); end Gen_Test_Client; > So is it this way correct: > package Pack1 is > generic > type Element is private; > package Child_Pack is > procedure Proc(El: Element); > end Child_Pack; > end Pack1; Strictly speaking, that's a subpackage. A child package is specified=20 separately. (With Gnat it will be in its own file.) package Parent is package Subpackage is end Subpackage; end Parent; package Parent.Child_Package is end Parent.Child_Package; > with Pack1; -- by the way when I write here: with Pack1.Child_Pack; I g= et a=20 > compilation-error. Why? When you write "with Pack1;" you get access to everything in Pack1,=20 including subpackages. For a child package you'd have to write "with=20 Parent.Child_Package;". --=20 Bj=F6rn Persson PGP key A88682FD omb jor ers @sv ge. r o.b n.p son eri nu