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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no 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!.POSTED!not-for-mail From: Georg Bauhaus Newsgroups: comp.lang.ada Subject: Re: no code generation for c strings Date: Sat, 4 Jun 2016 08:31:14 +0200 Organization: A noiseless patient Spider Message-ID: References: <369391051.486634184.002061.laguest-archeia.com@nntp.aioe.org> <2127654327.486638591.658765.laguest-archeia.com@nntp.aioe.org> Reply-To: nonlegitur@futureapps.de Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Sat, 4 Jun 2016 06:31:14 -0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="35e01dae5c3eca4ef22a4e4dff45f722"; logging-data="31792"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/MEgJJmU3sTHS0DtRjwzSL6UQiiIu7hGE=" User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 In-Reply-To: Cancel-Lock: sha1:W2Wws7D8eMUC8+Z+br0tT/rOPaA= Xref: news.eternal-september.org comp.lang.ada:30599 Date: 2016-06-04T08:31:14+02:00 List-Id: On 03.06.16 19:00, Lucretia wrote: > On Friday, 3 June 2016 15:27:59 UTC+1, G.B. wrote: > >> If "&" will be become a function call, then >> >> S : constant char_array := ('h', 'e', 'l', 'l', 'o', nul); > > I want to avoid having to spell out all these function names like that thanks, and not really sure what you mean about the & there. > By RM4.9(6) and RM4.9(20), "&" might be a static function. I'm not sure. In any case, for S to become static, adding constraints seems to be sufficient: package Static is S : constant char_array := "hello" & nul; S1 : constant Char_Array (0 .. 5) := "hello" & nul; X : constant := S'Length; X1 : constant := S1'Length; end Static; 1. with Interfaces.C; use Interfaces.C; 2. 3. package Static is 4. S : constant char_array := "hello" & nul; 5. S1 : constant Char_Array (0 .. 5) := "hello" & nul; 6. 7. X : constant := S'Length; | >>> non-static expression used in number declaration >>> prefix is non-static array (RM 4.9(8)) 8. X1 : constant := S1'Length; 9. end Static; -- "HOTDOGS ARE NOT BOOKMARKS" Springfield Elementary teaching staff