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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,46b760ffb623378c X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news2.google.com!news.glorb.com!news2.glorb.com!wn11feed!worldnet.att.net!bgtnsc05-news.ops.worldnet.att.net.POSTED!53ab2750!not-for-mail Newsgroups: comp.lang.ada From: anon@anon.org (anon) Subject: Re: Hiding the value of Constants Reply-To: anon@anon.org (anon) References: <30696d63-16e8-44e2-a4a5-db5095d7cfec@m3g2000pri.googlegroups.com> X-Newsreader: IBM NewsReader/2 2.0 Message-ID: Date: Sat, 11 Jul 2009 19:06:32 GMT NNTP-Posting-Host: 12.65.162.18 X-Complaints-To: abuse@worldnet.att.net X-Trace: bgtnsc05-news.ops.worldnet.att.net 1247339192 12.65.162.18 (Sat, 11 Jul 2009 19:06:32 GMT) NNTP-Posting-Date: Sat, 11 Jul 2009 19:06:32 GMT Organization: AT&T Worldnet Xref: g2news2.google.com comp.lang.ada:6996 Date: 2009-07-11T19:06:32+00:00 List-Id: Like I sometime say, this preson could be a student so, you show him part of the answer but not al . It works, and it will work if you change the statement by using "constant" too. But you may have to add a couple of other statements, or not. In , AdaMagica writes: >On 10 Jul., 01:04, a...@anon.org (anon) wrote: >> This program and package shows how to hide an Integer. I guess the other >> guys are too busy. > >Rick wanted to know how to hide a constant's value, so this is not >what he asked for. This has been answered long ago. > >> package Y1 is >> >> =A0 Test_Value : Integer ; -- Value is hidden >> >> =A0 procedure dummy ; -- stops the compiler warnings >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 -- normally replaced by usable >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 -- routines. >> >> end Y1 ; > >You mean the warning that this package does not allow a body without >this Dummy? >If you need a body, do not define junk subprograms, use pragma >Elaborate_Body instead. > >package Y1 is > pragma Elaborate_Body; > Test_Value: Integer; -- Only initial value is hidden (if there >really is one), > -- it can be written by anyone. >end Y1 ;