comp.lang.ada
 help / color / mirror / Atom feed
From: "John R. Strohm" <strohm@airmail.net>
Subject: Re: Ada 0x, exception idea ?
Date: Sun, 27 Jul 2003 21:46:19 -0500
Date: 2003-07-27T21:46:19-05:00	[thread overview]
Message-ID: <bg246a$v5s@library1.airnews.net> (raw)
In-Reply-To: LGadnTxRQ9xh8bmiU-KYvg@gbronline.com

"Wesley Groleau" <wesgroleau@myrealbox.com> wrote in message
news:LGadnTxRQ9xh8bmiU-KYvg@gbronline.com...
> sk wrote:
> > wesgroleau@myrealbox.com :
> >  > case C_function (params) is
> >  >
> >  >   when 0        => null; -- success
> >  >   when Bummer   => raise Its_a_Bummer;
> >  >   when Darn     => raise Darn_it;
> >  >   when Blast    => raise Blast_It;
> >  >   when Disaster => raise Program_Error;
> >  >
> > This still seems a bit "visually-bulky" (for want
> > of a better expression) but interesting and cleaner
> > than possible pages of "if-then-elsif" before
> > resuming with the original purpose of the algorithm.
>
> Why is the above (which works now) more "bulky"
> than the requested
>
>     raise Its_A_Bummer when Result = Bummer;
>     raise Darn_It      when Result = Darn;
>     raise Blast_It     when Result = Blast;

Observe that you get PRECISELY the same result with

  if Result = Bummer then raise Its_A_Bummer; end if;
  if Result = Darn   then raise Darn_It;      end if;
  if Result = Blast  then raise Blast_It;     end if;







  reply	other threads:[~2003-07-28  2:46 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <3F229597.3090909@myob.com>
2003-07-27 11:42 ` Ada 0x, exception idea ? sk
2003-07-27 15:33   ` Nick Roberts
2003-07-27 17:13     ` Samuel Tardieu
2003-07-28 12:41       ` Nick Roberts
2003-07-28  0:23   ` Wesley Groleau
2003-07-28  2:46     ` John R. Strohm [this message]
2003-07-28  3:23       ` Hyman Rosen
2003-07-28  3:24       ` Hyman Rosen
2003-07-27 15:51 ` sk
2003-07-27 17:22   ` Nick Roberts
2003-07-27 19:30     ` sk
2003-07-27 23:04       ` John R. Strohm
2003-07-28  0:07     ` sk
2003-07-28  0:27       ` Wesley Groleau
2003-07-28  2:50       ` John R. Strohm
2003-07-28  0:21 ` sk
2003-07-28  8:38   ` Preben Randhol
2003-07-28 11:24 ` sk
2003-07-26 14:52 sk
2003-07-26 15:53 ` John R. Strohm
2003-07-26 17:08   ` sk
2003-07-26 17:08   ` sk
2003-07-27  2:46     ` Wesley Groleau
2003-07-27 16:35     ` Hyman Rosen
2003-07-27  9:10 ` Preben Randhol
replies disabled

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