comp.lang.ada
 help / color / mirror / Atom feed
From: anon@anon.org (anon)
Subject: Re: Hiding the value of Constants
Date: Thu, 09 Jul 2009 23:04:11 GMT
Date: 2009-07-09T23:04:11+00:00	[thread overview]
Message-ID: <LHu5m.431339$4m1.281390@bgtnsc05-news.ops.worldnet.att.net> (raw)
In-Reply-To: 30696d63-16e8-44e2-a4a5-db5095d7cfec@m3g2000pri.googlegroups.com

This program and package shows how to hide an Integer. I guess the other 
guys are too busy.

--
-- Test program
--
with Ada.Text_IO ;
use  Ada.Text_IO ;

with Y1 ;
use  Y1 ;

procedure Y is

begin
  Put ( "Hidden String" ) ;
  Put ( Integer'Image ( Test_Value ) ) ;
  New_Line ;
end Y ;

--
-- specs 
--

package Y1 is

  Test_Value : Integer ; -- Value is hidden

  procedure dummy ; -- stops the compiler warnings
                    -- normally replaced by usable 
                    -- routines.

end Y1 ;

--
-- Body 
--
package body Y1 is

  procedure dummy is -- stops the compiler warnings
    begin
      null ;
    end dummy ;

begin  -- Elaboration initializes variable

  Test_Value := 50 ;

end Y1 ;




In <30696d63-16e8-44e2-a4a5-db5095d7cfec@m3g2000pri.googlegroups.com>, Rick <rickduley@gmail.com> writes:
>Is it possible to declare a constant in a package specification
>without the user knowing the value of that constant?
>
>--------------------------------------------
>Rick Duley
>North Perth,
>Western Australia
>http://rickduley.webs.com
>                                      .-_|\
>                                     /     \
>                               perth *_.-._/
>                                          v
>aussie : 0409 106 049
>o'seas : +61 409 106 049
>--------------------------------------------
>"Ah, but a man's reach
>      should exceed his grasp,
>              Or what's a heaven for?"
>                Robert Browning (1812-1889)




  parent reply	other threads:[~2009-07-09 23:04 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 [this message]
2009-07-10  6:37   ` AdaMagica
2009-07-11 19:06     ` anon
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