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 21:53:15 GMT
Date: 2009-07-11T21:53:15+00:00	[thread overview]
Message-ID: <fR76m.109597$d36.74475@bgtnsc04-news.ops.worldnet.att.net> (raw)
In-Reply-To: 4a58e74a$0$30233$9b4e6d93@newsspool1.arcor-online.net

In the years, there has been a few people asking how to hide values or constant. 
Some say use private which the value is still known. Others say use functions 
which can be hidden by removing the source code of the body of the package, 
but requires a call runtime routine each time the value is needed. 

But the main problem is that each person who wants to hide a constant forgets 
is that all someone has to do is to write a simple program to print the value.  
So, except to may be getting bonus points from a prof, its a waste of time.

In my example I just showed a third way. To initialize the value at the 
Elaboration time instead of compile or using main runtime. 

You need to spead your weekends learning a few ticks of the trade about Ada.
The program works. Just play with it, you might learn that using functions or 
private section to hide a value is not the only way.


In <4a58e74a$0$30233$9b4e6d93@newsspool1.arcor-online.net>, Georg Bauhaus <rm.tsoh.plus-bug.bauhaus@maps.futureapps.de> writes:
>anon wrote:
>> Like I sometime say, this preson could be a student so, you show 
>> him part of the answer but not al .
>
>Yes. But in this case it seems fair to conclude,
>after reading the OP's messages, that there is no basis
>for an assumption like this. So this sounds kind of inadequate,
>at best, pardon me.
>
>> It works, and it will work if you 
>> change the statement by using "constant" too.
>
>No, it doesn't ...
>
>>  But you may have to 
>> add a couple of other statements,
>
>.... Yes...
>
>> or not.
>
>No...
>
>Teaching by creative progression using intermittent reinforcement
>is probably not a good excuse for the teacher missing the point?
>In particular when the "pupil" demonstrates prior knowledge beyond
>the above assumption ("my trusty Ada 95 Q&S guide...", he said, e.g.).
>Please.




  reply	other threads:[~2009-07-11 21:53 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
2009-07-11 19:26       ` Georg Bauhaus
2009-07-11 21:53         ` anon [this message]
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