comp.lang.ada
 help / color / mirror / Atom feed
From: Ted Dennison <dennison@telepath.com>
Subject: Re: Java vs. Ada - strings (was: C vs. Ada - strings)
Date: 2000/06/05
Date: 2000-06-05T00:00:00+00:00	[thread overview]
Message-ID: <8hgb3m$bs$1@nnrp1.deja.com> (raw)
In-Reply-To: LVu_4.10342$kf5.70362@typhoon.nyroc.rr.com

In article <LVu_4.10342$kf5.70362@typhoon.nyroc.rr.com>,
  "Pete" <tyrone@nowhere.org> 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.




  parent reply	other threads:[~2000-06-05  0:00 UTC|newest]

Thread overview: 74+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-05-02  0:00 C vs. Ada - strings Wes Groleau
2000-05-02  0:00 ` Robert A Duff
2000-05-03  0:00   ` Wes Groleau
2000-05-03  0:00     ` Tarjei Tj�stheim Jensen
2000-05-03  0:00       ` Ted Dennison
2000-05-03  0:00   ` Tarjei T. Jensen
2000-05-03  0:00     ` Charles Hixson
2000-05-04  0:00     ` Robert Dewar
2000-05-04  0:00       ` Charles Hixson
2000-05-06  0:00       ` Tarjei Tj�stheim Jensen
2000-05-04  0:00   ` Robert Dewar
2000-05-04  0:00     ` Hyman Rosen
2000-05-04  0:00       ` Jon S Anthony
2000-05-04  0:00       ` Robert Dewar
2000-05-04  0:00     ` Robert A Duff
2000-05-04  0:00       ` Robert Dewar
2000-05-05  0:00         ` Florian Weimer
2000-05-05  0:00           ` Pascal Obry
2000-05-05  0:00             ` Hyman Rosen
2000-05-06  0:00           ` Tarjei Tj�stheim Jensen
2000-05-06  0:00             ` Florian Weimer
2000-05-07  0:00               ` Robert Dewar
2000-05-09  0:00                 ` Florian Weimer
2000-05-02  0:00 ` Larry Kilgallen
2000-05-02  0:00 ` Ted Dennison
2000-05-03  0:00   ` Pascal Obry
2000-05-03  0:00     ` Keith Thompson
2000-05-04  0:00       ` Wes Groleau
2000-05-18  0:00       ` Pete
2000-05-18  0:00         ` dale
2000-05-18  0:00           ` Robert A Duff
2000-05-19  0:00             ` dale
2000-05-21  0:00             ` Robert Dewar
2000-05-22  0:00               ` Robert A Duff
2000-05-22  0:00                 ` Keith Thompson
2000-05-24  0:00                 ` 'img Peter Hermann
2000-05-24  0:00                   ` 'img Robert Dewar
2000-05-24  0:00                     ` 'img Ted Dennison
2000-05-25  0:00                       ` 'img Peter Hermann
2000-05-25  0:00                         ` 'img Keith Thompson
2000-05-25  0:00                           ` 'img Ted Dennison
2000-05-26  0:00                         ` 'img dmitry
2000-05-26  0:00                           ` 'img Brian Rogoff
2000-05-26  0:00                             ` 'img Robert Dewar
2000-05-26  0:00                           ` 'img Robert Dewar
2000-05-25  0:00                       ` 'img Robert Dewar
2000-05-19  0:00         ` C vs. Ada - strings Geoff Bull
2000-05-19  0:00           ` mike
2000-05-21  0:00           ` Robert Dewar
2000-06-03  0:00           ` Pete
2000-06-03  0:00             ` Java vs. Ada - strings (was: C vs. Ada - strings) Ted Dennison
2000-06-04  0:00               ` Pete
2000-06-04  0:00                 ` Jean-Pierre Rosen
2000-06-04  0:00                   ` Pete
2000-06-05  0:00                     ` Jean-Pierre Rosen
2000-06-05  0:00                 ` Ted Dennison [this message]
2000-06-05  0:00                   ` Marin D. Condic
2000-06-05  0:00                     ` David Botton
2000-06-05  0:00                       ` Marin D. Condic
2000-06-06  0:00                     ` Robert A Duff
2000-06-06  0:00                   ` Ken Garlington
2000-06-06  0:00                     ` Marin D. Condic
2000-06-04  0:00               ` Robert I. Eachus
2000-06-03  0:00             ` C vs. Ada - strings Ken Garlington
2000-06-03  0:00               ` Ted Dennison
2000-06-04  0:00                 ` Dale Stanbrough
2000-06-04  0:00                 ` Ken Garlington
2000-05-03  0:00   ` Wes Groleau
2000-05-03  0:00     ` Ted Dennison
2000-05-04  0:00   ` Ole-Hjalmar Kristensen
2000-05-04  0:00     ` Gautier
2000-05-05  0:00 ` Florian Weimer
2000-05-05  0:00   ` Robert Dewar
2000-05-05  0:00   ` Ted Dennison
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox