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,e8fd9bf92374a60a X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!w5g2000prd.googlegroups.com!not-for-mail From: Adam Beneschan Newsgroups: comp.lang.ada Subject: Re: Declaration of private type Containers Date: Fri, 30 May 2008 09:00:38 -0700 (PDT) Organization: http://groups.google.com Message-ID: <40f1bdc6-ad4a-48ee-b3fc-6d44ac24955b@w5g2000prd.googlegroups.com> References: <6d6feee1-fe69-4d19-9745-4748d341a56e@r66g2000hsg.googlegroups.com> <9hro1g.ni4.ln@hunter.axlog.fr> <8910e931-889f-4617-a249-71b5016a13e2@r66g2000hsg.googlegroups.com> NNTP-Posting-Host: 66.126.103.122 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1212163238 11626 127.0.0.1 (30 May 2008 16:00:38 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 30 May 2008 16:00:38 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: w5g2000prd.googlegroups.com; posting-host=66.126.103.122; posting-account=duW0ogkAAABjRdnxgLGXDfna0Gc6XqmQ User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.12) Gecko/20050922 Fedora/1.7.12-1.3.1,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:483 Date: 2008-05-30T09:00:38-07:00 List-Id: On May 30, 6:59 am, alexander.kle...@web.de wrote: > Thanks so far. > So if I understand you right, there is no way to declare the list > package within the spec file of My_Type beside declaring My_Type > public? You could use a nested package, although I'm not sure if this would give you what you want: package A is package Nested is type My_Type is private; private type My_Type is ... end Nested; subtype My_Type is Nested.My_Type; package My_Type_Lists is new Ada.Containers.Doubly_Linked_List (Element_Type => My_Type); end A; This is legal, and My_Type_Lists is now inside A as you want, but now only the body of A.Nested will have access to the full definition of Nested. Maybe it could be made to work, though. -- Adam