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 X-Google-Thread: 103376,c406e0c4a6eb74ed X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!proxad.net!news.cs.univ-paris8.fr!news.zanker.org!newsfeed00.sul.t-online.de!newsmm00.sul.t-online.de!t-online.de!news.t-online.com!not-for-mail From: Martin Krischik Newsgroups: comp.lang.ada Subject: Re: ADA Popularity Discussion Request Date: Thu, 16 Sep 2004 09:38:17 +0200 Organization: AdaCL Message-ID: <1164383.Vq7EPUUJyU@linux1.krischik.com> References: <49dc98cf.0408110556.18ae7df@posting.google.com> <2cR0d.1623$IO5.1267@trndny04> <17sx057ro5jw5$.t2qlaeoxg611$.dlg@40tude.net> <1095082522.132276@master.nyc.kbcfp.com> <18ym85v67zof3$.7oqswzjfgswr.dlg@40tude.net> <1095090665.624419@master.nyc.kbcfp.com> <68zmgy3b894u.rs67cy6jjfiq$.dlg@40tude.net> Reply-To: krischik@users.sourceforge.net Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Trace: news.t-online.com 1095320557 07 29080 ciWfXBzJ1Oh0zpy 040916 07:42:37 X-Complaints-To: usenet-abuse@t-online.de X-ID: EGmy74ZeQeQpjcC5SED6si5YkLLkw3mBmK256MSZc1itQwnWr0L4kB User-Agent: KNode/0.7.7 Xref: g2news1.google.com comp.lang.ada:3763 Date: 2004-09-16T09:38:17+02:00 List-Id: Kevin Cline wrote: > Georg Bauhaus wrote in message > news:... >> Dmitry A. Kazakov wrote: >> : This is why I wrote about incorrectness. IF Ada's strings were designed >> : as a set of related types, then "..." literals could be ones >> : of/convertible to Unbounded_String and so an initialized ragged array >> : would be no problem, instead of horrific: >> : >> : type Ragged is array (Integer range <>) of Unbounded_String; >> : X : constant Ragged := >> : ( To_Unbounded_String ("1"), >> : To_Unbounded_String ("12"), >> : To_Unbounded_String ("13") >> : ); >> >> Is it really a good idea to sprinkle source code with unnamed >> string values? (No matter in what language.) If all of them are >> isolated in some module(s), where's the problem. Is it an >> aesthetical problem to have to use Ada's verbosity with strings? > BTW, the code above will also use memory inefficiently since there > will be two copies of each string, one constant and one unbounded. Now that you say it: True. Mind you, if space is a problem, you can always do it the C way: String_1 : aliased String = "1"; String_12 : aliased String = "12"; String_13 : aliased String = "13"; type String_Access is access all String; type Ragged is array (Integer range <>) of String_Access; X : constant Ragged := ( String_1'Access, String_12'Access, String_13'Access ); Of corse, it does not win a price with being compact code - but it does work with contrained records as well. With Regards Martin -- mailto://krischik@users.sourceforge.net http://www.ada.krischik.com