From: "Mark Lundquist" <no.spam@getalife.com>
Subject: Re: List Container Strawman 1.4
Date: Mon, 17 Dec 2001 08:34:35 GMT
Date: 2001-12-17T08:34:35+00:00 [thread overview]
Message-ID: <v6iT7.14178$Kg2.1380222@rwcrnsc51> (raw)
In-Reply-To: 87heqs5awc.fsf@deneb.enyo.de
"Florian Weimer" <fw@deneb.enyo.de> wrote in message
news:87heqs5awc.fsf@deneb.enyo.de...
> Ted Dennison<dennison@telepath.com> writes:
>
> > I have posted a strawman version 1.4 of the standard Ada List container
at
> > http://www.telepath.com/dennison/Ted/Containers-Lists-Unbounded.ads.html
.
>
>
> -- List <---> Unconstrained array conversions.
>
> type Element_Array is array (Natural range <>) of Element;
>
> function To (Source : Element_Array) return List;
> function From (Source : List) return Element_Array;
>
> What about a generic version of To and From which can handle arrays
> with different index types?
Interesting idea, but I doubt if it would be useful enough to be justified.
A list abstraction of this sort is unbounded, and since the only reason you
would convert To it from one of these things with a non-integer index type
would be to convert From the list back to it again, you're not going to be
adding or deleting elements... using a list this way (e.g. to find or sort)
is quite roundabout, it would be much better to have a Fixed variant of the
sequence abstraction.
'To' is probably much more useful than 'From', in any case (you can use an
aggregate notation to initialize your list).
>
> -- Passive iterator. Operation will be applied on each element on the
list
> -- Opertion can terminate this process early by setting Quit to True.
>
> generic
> with procedure Operation (Target : in out Element; Quit : out
Boolean);
> procedure Passive_Iterator (Target : in out List);
>
>
> I'd like to suggest to make Quit mode "in out", with a default of
> False.
There are no defaults for anything other than an "in" mode parameter.
>
> -- Sorting sub-package.
> -- To sort in increasing order, use the ">" routine for the
Reverse_Order
> -- parameter. To sort in decreasing order, substitute your "<" routine
for
> -- the Reverse_Order parameter. :-)
>
> I think the Reverse_Order predicate should be named differently, so
> that it's clear from its name that it's a predicate. "Reverse_Order"
> could also mean "Reverse the order of the elments.", not just "Are
> these elements in reversed order?".
I must say I don't care much for these attempts to avoid using a relational
operator for the predicate ("Swap", "Reverse_Order"). They are a case of
the cure being worse than the disease. Besides being obtuse and
bletcherous, they lack the notational convenience provided by a relational
operator with a box (<>) default.
-- mark
next prev parent reply other threads:[~2001-12-17 8:34 UTC|newest]
Thread overview: 64+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-12-13 3:23 List Container Strawman 1.4 Ted Dennison
2001-12-13 18:11 ` Brian Hanson
2001-12-13 23:02 ` Nick Roberts
2001-12-14 15:19 ` Ted Dennison
2001-12-14 23:54 ` Ted Dennison
2001-12-15 2:06 ` Server - tasking and long lived connections Eric Merritt
2001-12-15 3:10 ` James Rogers
2001-12-15 12:10 ` Florian Weimer
2001-12-15 14:38 ` Larry Kilgallen
2001-12-15 16:51 ` Steve Doiel
2001-12-17 9:15 ` Thierry Lelegard
2001-12-17 9:34 ` Jean-Pierre Rosen
2001-12-17 10:16 ` Thierry Lelegard
2001-12-18 9:08 ` Jean-Pierre Rosen
2001-12-17 15:08 ` Larry Kilgallen
2001-12-17 15:39 ` Pat Rogers
2001-12-19 18:20 ` Matthew Heaney
2001-12-19 18:50 ` Eric Merritt
2001-12-15 1:20 ` List Container Strawman 1.4 Nick Roberts
2001-12-15 20:29 ` Ted Dennison
2001-12-16 18:45 ` Nick Roberts
2001-12-21 15:53 ` Ted Dennison
2001-12-21 16:42 ` Marin David Condic
2001-12-21 18:28 ` Ted Dennison
2001-12-21 18:47 ` Marin David Condic
2001-12-21 19:39 ` Ted Dennison
2001-12-21 19:48 ` Marin David Condic
2001-12-22 12:29 ` Simon Wright
2001-12-21 20:03 ` Nick Roberts
2001-12-21 16:52 ` Marin David Condic
2001-12-21 18:41 ` Ted Dennison
2001-12-21 19:14 ` Marin David Condic
2001-12-21 21:13 ` Ted Dennison
2001-12-22 5:34 ` John B. Matthews
2001-12-21 20:19 ` Stephen Leake
2001-12-21 21:35 ` Ted Dennison
2001-12-24 11:58 ` Florian Weimer
2001-12-24 14:42 ` Eric Merritt
2001-12-24 22:47 ` Ted Dennison
2001-12-25 22:15 ` Florian Weimer
2001-12-28 13:58 ` Ted Dennison
2001-12-21 17:43 ` Stephen Leake
2001-12-21 18:44 ` Ted Dennison
2001-12-16 21:53 ` Larry Hazel
2001-12-15 22:27 ` Ted Dennison
2001-12-16 4:32 ` Darren New
2001-12-24 13:53 ` Florian Weimer
2001-12-15 23:19 ` Florian Weimer
2001-12-16 4:46 ` Ted Dennison
2001-12-24 13:57 ` Florian Weimer
2001-12-28 14:00 ` Ted Dennison
2001-12-28 16:43 ` Hyman Rosen
2001-12-28 19:12 ` Nick Roberts
2001-12-28 19:49 ` Matthew Heaney
2001-12-29 23:23 ` Matthew Heaney
2001-12-30 6:31 ` Hyman Rosen
2002-01-03 0:09 ` Matthew Heaney
2002-01-03 0:20 ` Brian Rogoff
2001-12-17 8:34 ` Mark Lundquist [this message]
2001-12-18 21:56 ` Florian Weimer
2001-12-18 21:54 ` Larry Kilgallen
2001-12-18 22:34 ` Mark Lundquist
2001-12-19 4:03 ` Nick Roberts
2001-12-24 13:54 ` Florian Weimer
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox