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=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=unavailable autolearn_force=no version=3.4.4 X-Google-Thread: 103376,ff6dd65dff421bcf,start X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!news2.google.com!proxad.net!usenet-fr.net!news.enst.fr!melchior!cuivre.fr.eu.org!melchior.frmug.org!not-for-mail From: "Christopher Gosset" Newsgroups: comp.lang.ada Subject: Protected types private part visibility , helpfull hints needed. Date: Thu, 28 Apr 2005 13:30:12 +0200 Organization: Cuivre, Argent, Or Message-ID: NNTP-Posting-Host: lovelace.ada-france.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: melchior.cuivre.fr.eu.org 1114687834 85023 212.85.156.195 (28 Apr 2005 11:30:34 GMT) X-Complaints-To: usenet@melchior.cuivre.fr.eu.org NNTP-Posting-Date: Thu, 28 Apr 2005 11:30:34 +0000 (UTC) To: Return-Path: X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.2627 Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 In-Reply-To: <20050428025529.717ED4C40D8@lovelace.ada-france.org> X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at ada-france.org X-BeenThere: comp.lang.ada@ada-france.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Gateway to the comp.lang.ada Usenet newsgroup" List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Xref: g2news1.google.com comp.lang.ada:10777 Date: 2005-04-28T13:30:12+02:00 I am making a library consisting of several packages. I wished to make all memory management and other "house-holding" functions private by having them in private packages and to make all details that is not a part of the "client-view" private. So I have a package spec with a protected type that look something like this Generic Type Item_Type (<>) is Private ; Package Protected_List is Protected Type List is Procedure Add( Item : In Item_Type) ; Function Item(Index : In Positive) Return Item_Type ; Private Internal_List_Structure : Internal_List ; ----------< This is the problem line I would like the internal list structure to be declared in a PRIVATE package and be visible to this private part >------- End List ; Private Type Item_Pointer is Access Item_Type ; End Protected_List ; This does not work! This is because the Private part of the Protected Type Declaration is a PART OF THE PUBLIC PART OF THE PACKAGE SPEC ! Is there a reason behind this design? Wouldn't it be more reasonable that the private part of a Protected Type should be a part of the PRIVATE part of the package spec and thus be able to use types and procedures declared in private packages and private parts of the parent ? The private part of the protected type should never be visible to the client anyway and the fact that all types and pakcages used in the protected type private part must be Public destroys my absctraction! Am I correct in my assumptions or is there something I have missed? Helpfull hints will be appriciated! /CG