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,c71aef5bb0ff1a93 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-05-02 10:12:10 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!skynet.be!skynet.be!louie!tlk!not-for-mail Sender: lbrenta@lbrenta.corp.emc.com Newsgroups: comp.lang.ada Subject: Re: recursive types and generics References: <3eb29aa6$1_3@news.arrakis.es> From: Ludovic Brenta Date: 02 May 2003 19:12:25 +0200 Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii NNTP-Posting-Host: 213.190.149.159 X-Trace: 1051895521 reader0.news.skynet.be 690 fa058819/213.190.149.159:55605 X-Complaints-To: abuse@skynet.be Xref: archiver1.google.com comp.lang.ada:36874 Date: 2003-05-02T19:12:25+02:00 List-Id: How about this: procedure Test is generic type Element is private; package Sequence is type Kind_Of_Element is (Nothing, Leaf, Seq); type Sequence_Element (Kind : Kind_Of_Element) is private; type Sequence is access Sequence_Element; private type Sequence_Element (Kind : Kind_Of_Element) is record Next_Element : Sequence; case Kind is when Nothing => null; when Leaf => Payload : Element; when Seq => Sub_Sequence : Sequence; end case; end record; end Sequence; package My_Sequence is new Sequence (Element => Integer); type Seq_Access is new My_Sequence.Sequence; begin null; end Test;