comp.lang.ada
 help / color / mirror / Atom feed
From: anon@anon.org (anon)
Subject: Re: Hiding the value of Constants
Date: Sat, 11 Jul 2009 19:06:32 GMT
Date: 2009-07-11T19:06:32+00:00	[thread overview]
Message-ID: <Yo56m.436627$4m1.390223@bgtnsc05-news.ops.worldnet.att.net> (raw)
In-Reply-To: a6924870-4fe8-4e56-8a5b-23a663262778@d32g2000yqh.googlegroups.com

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 <a6924870-4fe8-4e56-8a5b-23a663262778@d32g2000yqh.googlegroups.com>, AdaMagica <christoph.grein@eurocopter.com> 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 ;




  reply	other threads:[~2009-07-11 19:06 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-07  8:48 Hiding the value of Constants Rick
2009-07-07  8:54 ` xavier grave
2009-07-07  8:58   ` AdaMagica
2009-07-07  9:41 ` Georg Bauhaus
2009-07-07 10:41   ` Hibou57 (Yannick Duchêne)
2009-07-07 15:51     ` Adam Beneschan
2009-07-07 16:26       ` Hibou57 (Yannick Duchêne)
2009-07-07 18:48       ` Dmitry A. Kazakov
2009-07-07 19:05         ` Adam Beneschan
2009-07-07 19:53           ` Dmitry A. Kazakov
2009-07-07 20:28             ` Adam Beneschan
2009-07-07 20:57               ` Dmitry A. Kazakov
2009-07-08 10:25                 ` Georg Bauhaus
2009-07-08 12:20                   ` Dmitry A. Kazakov
2009-07-09 23:04 ` anon
2009-07-10  6:37   ` AdaMagica
2009-07-11 19:06     ` anon [this message]
2009-07-11 19:26       ` Georg Bauhaus
2009-07-11 21:53         ` anon
2009-07-11 22:03           ` Albrecht Käfer
2009-07-11 22:15           ` Ed Falis
2009-07-15  9:30             ` anon
2009-07-11 23:31           ` Egil
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox