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,e8fd9bf92374a60a X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local02.nntp.dca.giganews.com!nntp.comcast.com!news.comcast.com.POSTED!not-for-mail NNTP-Posting-Date: Fri, 30 May 2008 21:03:48 -0500 From: "Steve" Newsgroups: comp.lang.ada References: <6d6feee1-fe69-4d19-9745-4748d341a56e@r66g2000hsg.googlegroups.com> <9hro1g.ni4.ln@hunter.axlog.fr> <8910e931-889f-4617-a249-71b5016a13e2@r66g2000hsg.googlegroups.com> Subject: Re: Declaration of private type Containers Date: Fri, 30 May 2008 19:04:07 -0700 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.3138 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198 X-RFC2646: Format=Flowed; Original Message-ID: X-Usenet-Provider: http://www.giganews.com NNTP-Posting-Host: 24.20.111.206 X-Trace: sv3-wcUAk/EHYZKOcm1jhFuFWv0rZBncY2LNjs+4SLGtyj2RI3mDCBH0Er3AvJEuIWZ2Xgu4mMX/KN1U1DH!EJK8KdSmHN+hIzx619UnwkMtqdy7VUp10J5UiwzpJPoxbmWEKNF8f9B/sQMrYddTC0CP7Rtj7Qa+!CXlumYKHWJ8pUdLqoOLMyOFugEJQUg== X-Complaints-To: abuse@comcast.net X-DMCA-Complaints-To: dmca@comcast.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.39 Xref: g2news1.google.com comp.lang.ada:492 Date: 2008-05-30T19:04:07-07:00 List-Id: wrote in message news:8910e931-889f-4617-a249-71b5016a13e2@r66g2000hsg.googlegroups.com... > 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? ... That depends on how you define public. I don't think Ada has a definition of public. In Ada if you're going to use a type it must be visible to the code that uses it. For private types, to be able to use the type the declaration must be visible, but not the definition. So when you have: package A is type My_Record is private; package My_List is new ListPackage( My_Record ); private type My_Record is record field : Field_Type; end record; end A; In order to define MyList as a list of My_Record's, My_Record must be visible, but the defintion of My_Record may still be private. In essance users of Package A will know that My_Record exists, and they will know that My_List is a generic package that is instantiated for My_Record, buty they won't know what My_Record looks like (they can't see into the private section). You may already understand this, but I wasn't sure by your post. Regards, Steve (The Duck) > ... I suppose I have to source out the subprograms using the list > instances in their parameter list out of package A as well... > So my solution now is a new package spec and body called A.Containers, > which contains all the container packages and subprograms formerly > declared in A (which brought the error with private types). The > alternative would be your suggestion to declare the package as > A.My_Types_List in package B. Hope that's what you meant, otherwise > please correct me.