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!news1.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: Thu, 09 Jul 2009 23:04:11 GMT NNTP-Posting-Host: 12.65.108.27 X-Complaints-To: abuse@worldnet.att.net X-Trace: bgtnsc05-news.ops.worldnet.att.net 1247180651 12.65.108.27 (Thu, 09 Jul 2009 23:04:11 GMT) NNTP-Posting-Date: Thu, 09 Jul 2009 23:04:11 GMT Organization: AT&T Worldnet Xref: g2news2.google.com comp.lang.ada:6927 Date: 2009-07-09T23:04:11+00:00 List-Id: 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 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)