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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,5430b81ad265fc75 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-04-16 09:40:07 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!msunews!not-for-mail From: "Chad R. Meiners" Newsgroups: comp.lang.ada Subject: Re: Array Of Constant Strings? Date: Wed, 16 Apr 2003 12:35:01 -0400 Organization: Michigan State University Message-ID: References: <19guh-2f4.ln1@beastie.ix.netcom.com> <3E4D46B9.6060805@acm.org> <1ec946d1.0304151817.7182ecd8@posting.google.com> NNTP-Posting-Host: arctic.cse.msu.edu X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 Xref: archiver1.google.com comp.lang.ada:36191 Date: 2003-04-16T12:35:01-04:00 List-Id: "Matthew Heaney" wrote in message news:1ec946d1.0304151817.7182ecd8@posting.google.com... > Georg Bauhaus wrote in message news:... > > > > Will you collect a few impressions students have of the > > readability of Ada programs? (As this might add more substance to > > the argument that Ada syntax has advantages.) > > Well, here's one case where the C syntax is much simpler. In order to > declare an array of strings in C, all I have to do is: > Tucker showed this on CLA once: > > SA : constant String_Array := > (new String'("now"), > new String'("is"), > new String'("the"), > new String'("time")); > > Since all the string literals have static values, then no heap is > really allocated. But this is really a compiler optimization -- I > don't know whether you can really depend on it. Do you make it standard practice to second guess the compiler? As I recalled to do so is usually a bad idea. If it makes so much of a differencem, test your given compiler and complain to the vendor if it doesn't perform such an optimization.