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,b8b8a54001adc4d2 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!c13g2000cwb.googlegroups.com!not-for-mail From: danmcleran@hotmail.com Newsgroups: comp.lang.ada Subject: Re: Possible Ada deficiency? Date: 1 Jan 2005 11:43:15 -0800 Organization: http://groups.google.com Message-ID: <1104608595.353412.230130@c13g2000cwb.googlegroups.com> References: <1104516913.718856.94090@z14g2000cwz.googlegroups.com> <1104594390.142290.12210@z14g2000cwz.googlegroups.com> NNTP-Posting-Host: 172.140.140.110 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1104608599 19740 127.0.0.1 (1 Jan 2005 19:43:19 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sat, 1 Jan 2005 19:43:19 +0000 (UTC) In-Reply-To: User-Agent: G2/0.2 Complaints-To: groups-abuse@google.com Injection-Info: c13g2000cwb.googlegroups.com; posting-host=172.140.140.110; posting-account=LSix6gsAAACmBFWMCbh6syCaua0lawvj Xref: g2news1.google.com comp.lang.ada:7378 Date: 2005-01-01T11:43:15-08:00 List-Id: The point I'm trying to make is that if I want to write a package and hide certain information from all future child packages, a new construct is needed. One might want to share certain information with child packages, but force child packages to use a public or private interface for other information. For the sake of discussion, let's say that a new keyword, 'concealed', meant that this section could not be seen by the outside world, including child packages. One could then write a package with a public area, a private area (child packages could see this area), and a concealed area that no one, including child packages, could see. In this example, Secret_Type is a type that I want completely hidden from the outside world. There is a public interface, Print_Secret_Value, that anyone can call, and a private interface, Change_Concealed_Value, that is only callable from with the package body and all child packages. Simple example: -- This is not Ada! package Some_Package is --public area type Secret_Type is concealed; procedure Print_Secret_Value (Value : in Secret_Type); private --Child packages can see here procedure Change_Concealed_Value (New_Value : in Secret_Type); concealed --Child packages cannot see here, they must use the public and/or private interface type Secret_Type is record Secret_Value : Integer; end record end Some_Package;