From: tmoran on
>> Integer_IO.Get(Line(Last+1 .. Line'last), V(i), Last);
>...
>I'd still prefer all strings start at 1, and I'd do parsing of
>a text stream of integers in a different way (keep track
>of current position without using slices at all).
I wouldn't usually parse a text stream of integers like that
either, but it's a very short example, using a routine in the
standard library.

In general, the index of a found item in an array search is more
helpful than the offset. For instance,
function Find_Biggest(X : in Array_Type) return Index_Type;
leads to a cleaner recursive (or multitasking) divide-and-conquer
routine than returning an offset into the array. The offset is
a means to the end, while the index is the end itself, and you can't
return the index if you don't know the X'first.
From: tmoran on
>But nobody's taken my challenge: write down several features
>of Ada that you'd rather do without than slices.
It's hard to think, off the top of my head, of things I rarely use.
(Perhaps there's a cause-effect here :)
Aha! Goto statements!
From: Pascal Obry on
Bob,

> Yeah, everybody in this thread is singing the praises of slices.
> But nobody's taken my challenge: write down several features
> of Ada that you'd rather do without than slices. In other
> words, fill in the blank:
>
> I'd rather do without ________ than do without slices.

I won't respond to that. Everybody has it's own completion most probably
because of the domain of application. I suppose that in some embedded
device strings are not used at all. Should we remove them? Many people
have never use tasking, should we remove tasks?

Or maybe my response is I do not want to remove any feature from Ada.
Even entries families (that you have cited) are useful, I had use of
them in one application.

Pascal.

--

--|------------------------------------------------------
--| Pascal Obry Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--| http://www.obry.net - http://v2p.fr.eu.org
--| "The best way to travel is by means of imagination"
--|
--| gpg --keyserver keys.gnupg.net --recv-key F949BD3B

From: Robert A Duff on
tmoran(a)acm.org writes:

> In general, the index of a found item in an array search is more
> helpful than the offset. For instance,
> function Find_Biggest(X : in Array_Type) return Index_Type;
> leads to a cleaner recursive (or multitasking) divide-and-conquer
> routine than returning an offset into the array. The offset is
> a means to the end, while the index is the end itself, and you can't
> return the index if you don't know the X'first.

Right, although it might be better to return a cursor.

- Bob
From: Robert A Duff on
Pascal Obry <pascal(a)obry.net> writes:

> Or maybe my response is I do not want to remove any feature from Ada.

Fair enough, but that's not quite the same as saying that all
Ada features are equally useful. For ex., if you got rid of the
full coverage rules for case statements, I would kick and scream!

> Even entries families (that you have cited) are useful, I had use of
> them in one application.

Sure, I've used entry families. But you can use requeue instead,
so I judge entry families less useful than slices.

- Bob