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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,5430b81ad265fc75 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-02-22 11:31:39 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!nntp.abs.net!uunet!dca.uu.net!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Array Of Constant Strings? Date: 22 Feb 2003 14:31:36 -0500 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <19guh-2f4.ln1@beastie.ix.netcom.com> <3E4D46B9.6060805@acm.org> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls4.std.com 1045942296 2662 199.172.62.241 (22 Feb 2003 19:31:36 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Sat, 22 Feb 2003 19:31:36 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: archiver1.google.com comp.lang.ada:34438 Date: 2003-02-22T14:31:36-05:00 List-Id: Jeffrey Carter writes: > Name_List : constant array (1 .. 26) of Name_String := > (+"Anthony", > +"Barbara", > +"Claudia", > ... and so on. > > I don't like this, though. One of Ada's explicit design goals is to > emphasize ease of reading over ease of writing, and "To_Bounded_String" > is clearer than "+" to the reader. This is the opposite of C's > philosophy, in which ease of writing is everything and ease of reading > is unimportant. I don't agree. I think putting To_Bounded_String all over the place makes the code *less* readable. Bounded_String is, conceptually, a string type (even though the RM doesn't say so), so string literals ought to be allowed for it. Using varying-length strings should be just as painless as using Standard.String; literals, array indexing, etc, should be allowed without cluttering the code with explicit conversion operations that don't really do anything interesting. > If all the strings are always the same length, then using fixed length > strings is even simpler. However, I would tend to be suspicious of such > a requirement; things like that are almost always changed later. Well, we don't know why the OP wants same-length strings, but I agree -- such a restriction seems suspicious. - Bob