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 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!news2.google.com!news1.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!border2.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!peer-uk.news.demon.net!kibo.news.demon.net!news.demon.co.uk!demon!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Efficiently setting up large quantities of constant data Date: 14 Dec 2004 12:18:54 +0000 Organization: Pushface Sender: simon@smaug.pushface.org Message-ID: References: NNTP-Posting-Host: pogner.demon.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news.demon.co.uk 1103026747 3561 62.49.19.209 (14 Dec 2004 12:19:07 GMT) X-Complaints-To: abuse@demon.net NNTP-Posting-Date: Tue, 14 Dec 2004 12:19:07 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 Xref: g2news1.google.com comp.lang.ada:6937 Date: 2004-12-14T12:18:54+00:00 List-Id: In a spec ... type String_P is access constant String; type Stream_Element_Array_P is access constant Ada.Streams.Stream_Element_Array; type Format is (HTML, Plain, JPEG, GIF, PNG, OCTET_STREAM); type URL_Info is record URL : String_P; Doc : Stream_Element_Array_P; Form : Format; end record; type URL_Info_Array is array (Positive range <>) of URL_Info; type URL_Info_Array_P is access constant URL_Info_Array; in a body ... Url_1 : aliased constant String := "/index.html"; Doc_1 : aliased constant Stream_Element_Array := ( 60, 33, 45, 45, 32, 36, 73, 100, 58, 32, 105, 110, 100, 101, 120, 46, 104, 116, 109, 108, 44, 118, 32, 49, ....... 108, 62 ); Documents : aliased constant Url_Info_Array := ( 1 => (Url => Url_1'Access, Doc => Doc_1'Access, Form => HTML) ); function Static_Urls return Url_Info_Array_P is begin return Documents'Access; end Static_Urls; (on looking at this, I'm a bit surprised that I didn't need to say 'all' ..) -- Simon Wright 100% Ada, no bugs.