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,ec21c3c7cdc7ff3e X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news3.google.com!newshub.sdsu.edu!elnk-nf2-pas!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!newsread1.news.pas.earthlink.net.POSTED!a6202946!not-for-mail From: "Jeffrey R. Carter" Organization: jrcarter at acm dot org User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.12) Gecko/20050915 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: private types References: <1142279908.327131.230200@j52g2000cwj.googlegroups.com> In-Reply-To: <1142279908.327131.230200@j52g2000cwj.googlegroups.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Date: Tue, 14 Mar 2006 04:51:25 GMT NNTP-Posting-Host: 67.150.70.110 X-Complaints-To: abuse@earthlink.net X-Trace: newsread1.news.pas.earthlink.net 1142311885 67.150.70.110 (Mon, 13 Mar 2006 20:51:25 PST) NNTP-Posting-Date: Mon, 13 Mar 2006 20:51:25 PST Xref: g2news1.google.com comp.lang.ada:3349 Date: 2006-03-14T04:51:25+00:00 List-Id: ada_student@yahoo.com wrote: > Consider the following package declaration, > > package PrivateType is > > type MyInteger is private; > > procedure Read(O : out myInteger); > procedure Write(I : in MyInteger); > > private > > type MyInteger is range 1 .. 2**31 - 1; > > end; > > Why does Ada allow MyInteger to be made visible outside the > scope of PrivateType ? Doesnt it make the code less secure(for > example,consider an "uninitialized" object of type > PrivateType.MyInteger). Because that's what private means in Ada. I suggest you spend some time with an Ada text or tutorial. It appears that you're guessing at Ada based on experience with another language. On-line texts and tutorials are available at adapower.com and adaworld.com. If you're fairly experienced in another language, you might want to look at "Ada Distilled". It's fairly concise while still providing a good introduction to Ada concepts. -- Jeff Carter "You've got the brain of a four-year-old boy, and I bet he was glad to get rid of it." Horse Feathers 47