comp.lang.ada
 help / color / mirror / Atom feed
From: Marius Amado Alves <amado.alves@netcabo.pt>
To: comp.lang.ada@ada-france.org
Subject: Re: Mneson announcement and help request
Date: Wed, 02 Jun 2004 12:41:07 +0100
Date: 2004-06-02T12:41:07+01:00	[thread overview]
Message-ID: <mailman.34.1086176483.391.comp.lang.ada@ada-france.org> (raw)
In-Reply-To: <c9kd3v$i1n$1@a1-hrz.uni-duisburg.de>

Yes, this is a nice idiom. I tried to push something similar to the
Ada.Containers. More general. See the ARG discussion. Look for "Slice".
In time Mneson could grow it's one containers, featuring this. However
until hard evidence that exceptions are evil I don't see a strong reason
to change.

Georg Bauhaus wrote:
> Marius Amado Alves <amado.alves@netcabo.pt> wrote:
> :> In general, I hate to see code that uses exceptions for normal control flow
> :> processing. It certainly appears to
> :> me that your code that makes use of the various For_Each_XXX type procedures
> :> uses an exception
> :> raise to terminate the search when "done".
> : 
> : Yes, that is a controversial style. Some like it, some don't. Note the 
> : planned Ada standard containers are in this style.
> 
> How about this, which doesn't need exceptions:
> 
> with AI302.Containers.Ordered_Sets;
> 
> package Maa is
> 
>    type T is range -5 .. +5;
> 
>    package Sets_of_T is new AI302.Containers.Ordered_Sets(T);
> 
>    generic
>       with procedure Process(Pointee: Sets_of_T.Cursor);
>    procedure Traverse
>      (container: Sets_of_T.Set; Stop: Sets_of_T.Cursor);
> 
> 
> end Maa;
> 
> package body Maa is
> 
>    procedure Traverse
>      (container: Sets_of_T.Set; Stop: Sets_of_T.Cursor)
>    is
>       use Sets_of_T;
> 
>       current: Cursor := first(container);
>    begin
>       while current /= Stop loop
>          process(current);
>       end loop;
>    end Traverse;
> 
> end Maa;
> 
> _______________________________________________
> comp.lang.ada mailing list
> comp.lang.ada@ada-france.org
> http://www.ada-france.org/mailman/listinfo/comp.lang.ada
> 






  reply	other threads:[~2004-06-02 11:41 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-01 15:56 Mneson announcement and help request Marius Amado Alves
2004-06-02  2:26 ` Jeff C,
2004-06-02  3:06   ` Marius Amado Alves
2004-06-02 11:19     ` Georg Bauhaus
2004-06-02 11:41       ` Marius Amado Alves [this message]
     [not found]         ` <c9l0vo$pq3$1@sparta.btinternet.com>
2004-06-02 17:47           ` Marius Amado Alves
2004-06-02 19:46             ` Martin Dowie
2004-06-02 22:10           ` Randy Brukardt
2004-06-03  5:58             ` Martin Dowie
2004-06-04  3:21               ` Randy Brukardt
2004-06-04  5:55                 ` Martin Dowie
2004-06-04  7:30                   ` Jean-Pierre Rosen
2004-06-04 14:11                     ` Larry Kilgallen
2004-06-03  4:12           ` Jeffrey Carter
2004-06-03  5:48             ` Martin Dowie
2004-06-03  9:02             ` Martin Krischik
2004-06-02 11:41       ` Georg Bauhaus
2004-06-02 13:14         ` Marius Amado Alves
2004-06-03  4:09         ` Jeffrey Carter
2004-06-03 11:24           ` Georg Bauhaus
2004-06-02  3:21   ` Marius Amado Alves
2004-06-22 20:49     ` Jacob Sparre Andersen
2004-06-23  9:36       ` Marius Amado Alves
replies disabled

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