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: a07f3367d7,46b760ffb623378c X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!d32g2000yqh.googlegroups.com!not-for-mail From: AdaMagica Newsgroups: comp.lang.ada Subject: Re: Hiding the value of Constants Date: Thu, 9 Jul 2009 23:37:30 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <30696d63-16e8-44e2-a4a5-db5095d7cfec@m3g2000pri.googlegroups.com> NNTP-Posting-Host: 91.13.229.29 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1247207850 6179 127.0.0.1 (10 Jul 2009 06:37:30 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 10 Jul 2009 06:37:30 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: d32g2000yqh.googlegroups.com; posting-host=91.13.229.29; posting-account=rmHyLAoAAADSQmMWJF0a_815Fdd96RDf User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.0.11) Gecko/2009060215 Firefox/3.0.11,gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:6931 Date: 2009-07-09T23:37:30-07:00 List-Id: 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 ;