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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!gandalf.srv.welterde.de!news.jacob-sparre.dk!loke.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: What do you think about this? Date: Fri, 3 Jul 2015 22:30:09 -0500 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: <9894cde7-2cf8-4060-be65-857812ad7b09@googlegroups.com><17436268-aceb-461f-bdcf-eee8436cd0e6@googlegroups.com><86y4jaqzdx.fsf@stephe-leake.org><86oak5qulb.fsf@stephe-leake.org> <86k2usq66p.fsf@stephe-leake.org> <864mllqv7c.fsf@stephe-leake.org> NNTP-Posting-Host: rrsoftware.com X-Trace: loke.gir.dk 1435980609 26048 24.196.82.226 (4 Jul 2015 03:30:09 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Sat, 4 Jul 2015 03:30:09 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Xref: news.eternal-september.org comp.lang.ada:26601 Date: 2015-07-03T22:30:09-05:00 List-Id: "Simon Wright" wrote in message news:lyk2uhyrrt.fsf@pushface.org... > Laurent writes: > >> type String_Pointer is access all String; > > Or you could make this 'access constant String' (not sure this is Ada > 95, though) It is. It's not allowed in anonymous access in Ada 95, but it is allowed in type declarations. >> Prompt_1 : aliased String := "Enter a command >"; > > and this would be 'aliased constant String' > >> Prompt_Table : array (1 .. 4) of String_Pointer := >> (Prompt_1'Access, Prompt_2'Access, >> Prompt_3'Access, Prompt_4'Access); > > or you could say 'array (1 .. 4) of access constant String' and do away > with type String_Pointer. That's not Ada 95 (that was introduced [mistakenly, in hindsight] in Ada 2005). > > In any case Prompt_Table can be 'constant array'. > > I believe that GNAT has special circuitry to place all these strings and > Prompt_Table in ROM (i.e. no need for elaboration). Probably, but not all Ada compilers will do that. OTOH, it really doesn't matter unless you need to burn a ROM (the time elaboration takes is usually small enough to ignore). Randy.