comp.lang.ada
 help / color / mirror / Atom feed
From: Martin Krischik <krischik@users.sourceforge.net>
Subject: Re: Allocation of local constant arrays
Date: Fri, 21 May 2004 11:44:28 +0200
Date: 2004-05-21T11:44:28+02:00	[thread overview]
Message-ID: <1243344.38CSDDicXX@linux1.krischik.com> (raw)
In-Reply-To: pan.2004.05.20.19.22.24.392236@nowhere.net

Freejack wrote:

> On Thu, 20 May 2004 13:24:07 +0200, Martin Krischik wrote:
> 
>> 
>> Normally I put them with the procedure. Sometimes I put them in packages
>> inside the procededure:
>> 
>> procedure Proc
>> is
>>   package Pack
>>     ...
>>   end Pack;
>> begin
>> ...
>> 
>> With Regards
>> 
>> Martin
> 
> 
> Wouldn't that kind of declaration essentially make the variables static
> constants, unchangeable from one call of the procedure to another.

Yes. But beware: if Pack had an evaluation code it would be called with each
call to Proc.

> And 
> would I reference the var as Proc.Pack.foobar or just Pack.foobar?

Both can be used.
 
> Although it looks like this type of definition would help the compiler
> perform optimizations.

That's the idea. Usually I just trust the compiler to do it right.

With Regards

Martin
-- 
mailto://krischik@users.sourceforge.net
http://www.ada.krischik.com




  reply	other threads:[~2004-05-21  9:44 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-19 15:07 Allocation of local constant arrays Davide
2004-05-19 15:17 ` Davide
2004-05-19 21:16 ` Robert I. Eachus
2004-05-20  9:56   ` Davide
2004-05-20 11:24     ` Martin Krischik
2004-05-20 18:36       ` Freejack
2004-05-21  9:44         ` Martin Krischik [this message]
2004-05-21  2:32     ` Steve
2004-05-21  3:07     ` Robert I. Eachus
replies disabled

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