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=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,55a8252137b5ef97 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!newsfeed2.dallas1.level3.net!news.level3.com!newsfeed-00.mathworks.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "Alex R. Mosteo" Newsgroups: comp.lang.ada Subject: Re: Efficiently setting up large quantities of constant data Date: Thu, 16 Dec 2004 19:29:18 +0100 Message-ID: <41C1D3FE.2090207@mailinator.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net J/6K2id19aeTkUvGtoU+uwM0JhKWyfufg4cqVVVkIxdlpK7e0= User-Agent: Mozilla Thunderbird 1.0 (X11/20041206) X-Accept-Language: en-us, en In-Reply-To: Xref: g2news1.google.com comp.lang.ada:6998 Date: 2004-12-16T19:29:18+01:00 List-Id: Michael Mounteney wrote: > I want to set up about 100 variables which somehow reference > variable-length arrays of other things. The other things, for a given > variable, are fixed. Simplifying: > > type component is > record > X : character; > end record; > > type component_list is array (positive range <>) of component; > > type component_ref is access all component_list; > > type structure is > record > part : component_ref; > end record; > > So I will have lots of structures scattered about, which will be > completely constant. I would like to enforce this constancy, but Ada > (as far as I know) does not (unlike C++; that should get some hackles > rising) allow `constant' to be splashed about in type definitions. > This is on GNAT, which does not support pragma read_only. > > Is there any way to ensure that these data are not modified, other > than by forbidding direct access to structure.part etc? Reading the other posts I think you may be interested in the resource management of AWS [Ada Web Server].