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.3 required=5.0 tests=BAYES_00,INVALID_MSGID, LOTS_OF_MONEY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,f868292008c639ce X-Google-Attributes: gid103376,public From: Ted Dennison Subject: Re: Java vs. Ada - strings (was: C vs. Ada - strings) Date: 2000/06/05 Message-ID: <8hgb3m$bs$1@nnrp1.deja.com>#1/1 X-Deja-AN: 631267675 References: <390F0D93.F835FAD9@ftw.rsc.raytheon.com> <8en5o9$ihe$1@nnrp1.deja.com> <8eonos$e70$1@wanadoo.fr> <1fIU4.4668$Rx3.250161@typhoon.nyroc.rr.com> <3924B730.AFB52C1C@acenet.com.au> <39394E0B.75BD479C@telepath.com> X-Http-Proxy: 1.0 x65.deja.com:80 (Squid/1.1.22) for client 204.48.27.130 Organization: Deja.com - Before you buy. X-Article-Creation-Date: Mon Jun 05 13:48:44 2000 GMT X-MyDeja-Info: XMYDJUIDtedennison Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.7 [en] (WinNT; I) Date: 2000-06-05T00:00:00+00:00 List-Id: In article , "Pete" wrote: > > > type String_Ptr is access String; > > type String_List is array (Natural range <>) of String_Ptr; > > AR : constant String_List := (new String'("have"), new String'("a"), new > > String'("good"), new String'("day")); > > my whole point is the complexity of the syntax. compare the above to > String st[] = new String[] { "have", "a", "good", "day"}; > The ada code above has two new types in order to process an array of > *primitive* types. This (a ragged array of strings) is *not* an everyday type, so its perfectly reasonable for a language to not have built-in support for it. Once you make the requisite declarations so that Ada has the type, the code is not that much more complicated . As the rest of my message said, its even *simpler* than Java if you create an abstract type for it. > > I've never done this myself because in 11 years of Ada work I've > > never had much need for ragged string arrays. That's probably why > > Ada doesn't come with a type for them. :-) > i've already had a use for them in the 6 months that i started this > new ada You're starting to get at my point here. Most of the "Ada's support for XXX sucks" folks come from the perspective of trying to use techniques designed around the features (and failings) of another language in Ada, rather than from a sober analysis of the full benefits and drawbacks of the supporting Ada features. If I were a betting man, I'd wager that this approach occured to you because you are used to using this (unusual) construct from a lanugage that makes it easy, and it would not have occurred at all in the code of a "native" Ada person. -- T.E.D. http://www.telepath.com/~dennison/Ted/TED.html Sent via Deja.com http://www.deja.com/ Before you buy.