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!gegeweb.org!news.ecp.fr!news.jacob-sparre.dk!loke.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Bounded String question Date: Thu, 12 Nov 2015 13:37:16 -0600 Organization: JSA Research & Innovation Message-ID: References: <7ba56b33-28d4-42d2-8b9b-5ad9f5beab8b@googlegroups.com> <87io597447.fsf@theworld.com> <66278720-249a-4191-a908-bb840e7f3ccc@googlegroups.com> <6d874e75-e2c9-47e9-b394-f04052f10aa3@googlegroups.com> <1a532527-f48c-4646-abb5-ec64b5e6106b@googlegroups.com> NNTP-Posting-Host: rrsoftware.com X-Trace: loke.gir.dk 1447357037 6653 24.196.82.226 (12 Nov 2015 19:37:17 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Thu, 12 Nov 2015 19:37:17 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Response X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Xref: news.eternal-september.org comp.lang.ada:28331 Date: 2015-11-12T13:37:16-06:00 List-Id: "G.B." wrote in message news:n22k4s$vk3$1@dont-email.me... > On 11.11.15 21:40, AdaMagica wrote: >> Am Mittwoch, 11. November 2015 21:32:39 UTC+1 schrieb Serge Robyns: >>> This how this whole thread started. That construct does not work >>> with pragma preelaborate. But this was exactly the code I had initially >>> :-) >> >> No complaint from GNAT GPL 2015: >> -------------------------------- >> >> with Ada.Strings; use Ada.Strings; >> with Ada.Strings.Bounded; >> >> procedure BS_Test is >> >> pragma Preelaborate; > > Are the requirements for Elaborate (or for Pure) different for > a library unit that is a subprogram? Yes. The Preelaborate rules only apply at library level, and a procedure is not library level by definition. One cannot declare a preelaborable bounded string constant, as the initialization will necessarily fail the preelaboration checks. I recently worked out a proposal that could have changed that, but it became way too complex and it went nowhere. (Recall the similar discussion here about having a preelaborable constant of type Address.) Randy. Randy.