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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,a81d7835683dac7b X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-09-13 23:51:36 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!cyclone.bc.net!sjc70.webusenet.com!news.webusenet.com!elnk-nf2-pas!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!stamper.news.atl.earthlink.net!newsread2.news.atl.earthlink.net.POSTED!not-for-mail Sender: mheaney@MHEANEYX200 Newsgroups: comp.lang.ada Subject: Re: Bases 1.52 References: <4a4de33a.0309021059.53f71234@posting.google.com> <4060780.x1l89WMggb@linux1.krischik.com> <17eddf9f.0309092349.2ff22de2@posting.google.com> <1301057.xhkpTmYQhd@linux1.krischik.com> From: Matthew Heaney Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sun, 14 Sep 2003 06:51:36 GMT NNTP-Posting-Host: 65.110.133.134 X-Complaints-To: abuse@earthlink.net X-Trace: newsread2.news.atl.earthlink.net 1063522296 65.110.133.134 (Sun, 14 Sep 2003 02:51:36 EDT) NNTP-Posting-Date: Sun, 14 Sep 2003 02:51:36 EDT Organization: EarthLink Inc. -- http://www.EarthLink.net Xref: archiver1.google.com comp.lang.ada:42470 Date: 2003-09-14T06:51:36+00:00 List-Id: Martin Krischik writes: > Yes, but to my knowlege you cant say: > > type Item'Class is private; This is all wrong. If you have this generic formal type: generic type T (<>) is private; package GP is ...; and this actual type: package Q is type T is tagged private; ... end Q; Then you can instantiate the generic package like this: package P is new GP (Q.T'Class); The type T'Class is a real type. It has a funny spelling, but it's a real type. You can declare objects of that type, both on the stack, like this: O : T'Class := ...; and on the heap, like this: O : T_Class_Access := new T'Class'(Item); You can write subprogram parameters --including function return types-- with that type. And you can use T'Class as the generic actual type in a generic instantiation.