From: John English <je@bton.ac.uk>
Subject: Re: Wanted: Ada STL. Reward: Ada's Future
Date: 1999/02/05
Date: 1999-02-05T00:00:00+00:00 [thread overview]
Message-ID: <36BABA14.22DCA8D9@bton.ac.uk> (raw)
In-Reply-To: m34sp32xty.fsf@mheaney.ni.net
Matthew Heaney wrote:
> John English <je@bton.ac.uk> writes:
>
> > In Ada this isn't possible -- e.g. type Foo is array(Boolean) of Bar
> > has no "beyond the end" index that can be used to form non-inclusive
> > ranges [i,j). This makes it hard to support arrays as "just another
> > collection type" in the way that the STL does, so you can't easily
> > define algorithms which can be applied impartially to arrays or
> > vectors or maps or whatever.
>
> The problem in your example is your array index. The rule in Ada is
> that an enumeration type is its own base type, and type Boolean has no
> other values than True and False.
Indeed.
> If you need to fall off the beginning or end of an array, you just need
> to make sure the base type of the index subtype has at least one extra
> value on either end, something like:
>
> type Color_Base is (First, Red, Green, Blue, Last);
>
> subtype Color_Type is Color_Base
> range Color_Base'Succ (First) .. Color_Base'Pred (Last);
... which means that you couldn't apply STL-type algorithms to *any*
array the way you can in C++. IMHO the nice thing about STL is the way
it lets you deal with arrays and user-defined containers in a completely
uniform manner.
> The idioms in both languages are completely different. So forget about
> the STL as a model for an Ada library.
Indeed. But *something* is needed; having everyone invent their own
propietary versions of common data types and algorithms is a complete
waste of time. Even if the STL model doesn't fit Ada, it's useful as
a reminder of what can/should be provided.
-----------------------------------------------------------------
John English | mailto:je@brighton.ac.uk
Senior Lecturer | http://www.it.bton.ac.uk/staff/je
Dept. of Computing | ** NON-PROFIT CD FOR CS STUDENTS **
University of Brighton | -- see http://burks.bton.ac.uk
-----------------------------------------------------------------
next prev parent reply other threads:[~1999-02-05 0:00 UTC|newest]
Thread overview: 102+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-01-31 0:00 Wanted: Ada STL. Reward: Ada's Future Alexy V Khrabrov
1999-01-31 0:00 ` Simon Wright
1999-02-01 0:00 ` Jerry van Dijk
1999-02-01 0:00 ` Marin David Condic
1999-02-01 0:00 ` dennison
1999-02-01 0:00 ` Stanley R. Allen
1999-02-01 0:00 ` Matthew Heaney
1999-02-01 0:00 ` Alexy V Khrabrov
1999-02-01 0:00 ` Matthew Heaney
1999-02-01 0:00 ` Jeff Carter
1999-02-01 0:00 ` Brian Rogoff
1999-02-01 0:00 ` Ehud Lamm
1999-02-02 0:00 ` Richard D Riehle
1999-02-03 0:00 ` robert_dewar
1999-02-02 0:00 ` Brian Rogoff
1999-02-02 0:00 ` robert_dewar
1999-02-04 0:00 ` Ehud Lamm
1999-02-03 0:00 ` John English
1999-02-03 0:00 ` Matthew Heaney
1999-02-03 0:00 ` Brian Rogoff
1999-02-04 0:00 ` Stephen Leake
1999-02-04 0:00 ` Hyman Rosen
1999-02-05 0:00 ` Stephen Leake
1999-02-05 0:00 ` Hyman Rosen
1999-02-04 0:00 ` Matthew Heaney
1999-02-04 0:00 ` Brian Rogoff
1999-02-05 0:00 ` Stephen Leake
1999-02-05 0:00 ` Brian Rogoff
1999-02-05 0:00 ` John English
1999-02-05 0:00 ` Brian Rogoff
1999-02-06 0:00 ` Matthew Heaney
1999-02-05 0:00 ` Tucker Taft
1999-02-05 0:00 ` Brian Rogoff
1999-02-05 0:00 ` Richard D Riehle
1999-02-05 0:00 ` John English [this message]
1999-02-05 0:00 ` Nick Roberts
1999-02-04 0:00 ` Ehud Lamm
1999-02-04 0:00 ` Al Christians
1999-02-04 0:00 ` Pat Rogers
1999-02-04 0:00 ` Larry Kilgallen
1999-02-04 0:00 ` Pat Rogers
1999-02-04 0:00 ` Larry Kilgallen
1999-02-05 0:00 ` robert_dewar
1999-02-05 0:00 ` Tom Moran
1999-02-05 0:00 ` dewar
1999-02-05 0:00 ` Tom Moran
1999-02-05 0:00 ` dewar
1999-02-05 0:00 ` dennison
1999-02-06 0:00 ` dewar
1999-02-08 0:00 ` dennison
1999-02-08 0:00 ` robert_dewar
1999-02-08 0:00 ` dennison
1999-02-09 0:00 ` robert_dewar
1999-02-09 0:00 ` dennison
1999-02-09 0:00 ` Nick Roberts
1999-02-07 0:00 ` Simon Wright
1999-02-08 0:00 ` Corey Minyard
1999-02-08 0:00 ` Open Source Licensing (was: Wanted: Ada STL. Reward: Ada's Future) dennison
1999-02-08 0:00 ` Corey Minyard
1999-02-09 0:00 ` robert_dewar
1999-02-09 0:00 ` Corey Minyard
1999-02-09 0:00 ` dennison
1999-02-09 0:00 ` Corey Minyard
1999-02-09 0:00 ` Wanted: Ada STL. Reward: Ada's Future robert_dewar
1999-02-09 0:00 ` dennison
1999-02-10 0:00 ` robert_dewar
1999-02-07 0:00 ` Simon Wright
1999-02-05 0:00 ` Larry Kilgallen
[not found] ` <36ba730b.35540068@ <79fmg1$fn0$1@nnrp1.dejanews.com>
1999-02-06 0:00 ` Larry Kilgallen
1999-02-05 0:00 ` robert_dewar
1999-02-05 0:00 ` robert_dewar
1999-02-05 0:00 ` Larry Kilgallen
1999-02-05 0:00 ` robert_dewar
1999-02-05 0:00 ` Tucker Taft
1999-02-05 0:00 ` dennison
1999-02-05 0:00 ` robert_dewar
1999-02-05 0:00 ` dennison
1999-02-06 0:00 ` Nick Roberts
[not found] ` <79f24e$t14 <36BB4162.52FC6D9F@averstar.com>
1999-02-05 0:00 ` dennison
1999-02-05 0:00 ` robert_dewar
1999-02-04 0:00 ` Brian Rogoff
1999-02-05 0:00 ` Matthew Heaney
1999-02-05 0:00 ` Brian Rogoff
1999-02-08 0:00 ` John English
1999-02-05 0:00 ` John English
1999-02-09 0:00 ` micro_ada
1999-02-05 0:00 ` Nick Roberts
1999-02-08 0:00 ` John English
1999-02-02 0:00 ` Pointer Arithmetic (was: Wanted: Ada STL....) adam
1999-02-02 0:00 ` William Clodius
1999-02-03 0:00 ` adam
1999-02-03 0:00 ` William Clodius
1999-02-03 0:00 ` Nick Roberts
1999-02-03 0:00 ` robert_dewar
1999-02-03 0:00 ` Jean-Pierre Rosen
1999-02-03 0:00 ` robert_dewar
1999-02-03 0:00 ` Nick Roberts
1999-02-03 0:00 ` robert_dewar
1999-02-03 0:00 ` Robert A Duff
1999-02-01 0:00 ` Wanted: Ada STL. Reward: Ada's Future Jeff Carter
1999-02-08 0:00 ` Michael F Brenner
1999-02-05 0:00 ` Corey Minyard
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox