From: sk <noname@myob.com>
To: comp.lang.ada@ada.eu.org
Subject: Re: Ada 0x, exception idea ?
Date: Sat, 26 Jul 2003 12:08:56 -0500
Date: 2003-07-26T12:08:56-05:00 [thread overview]
Message-ID: <mailman.2.1059239329.320.comp.lang.ada@ada.eu.org> (raw)
In-Reply-To: bfu8fb$gj1@library1.airnews.net
> Bletch.
>
> As you observe, your proposed constructs are precisely equivalent to
>
> call_procedure(..., success);
> if not success then
> raise call_failed;
> end if;
>
>Ada in general does not bother with unnecessary syntactic sugar,
> which is what this is.
... and as a "generalization", that is a dubious position.
For as long as I can remember, Ada IS ABOUT MAINTAINENCE, which is
about using "syntatic sugar" to make things absolutely clear.
READABILITY
raise Call_Error1 when Condition1;
raise Call_Error2 when Condition2;
raise Call_Error3 when Condition3;
raise Call_Error4 when Condition4;
raise Call_Error5 when Condition5;
... is lot more readable than and equivalent ...
if Condition1 then
raise Error1;
elsif Condition2 then
raise Error2;
elsif Condition3 then
raise Error3;
elsif Condition4 then
raise Error4;
elsif Condition5 then
raise Error5;
...
> ... procedure itself should raise the exception, not set a status
> flag ...
How nice for you to live in a purely Ada world :-)
The mostly "C" world I live in, where I have to interface Ada to the
underlying operating environment, almost always uses a return code
of some kind.
--
-------------------------------------------------
-- Merge vertically for real address
--
-- s n p @ t . o
-- k i e k c c m
-------------------------------------------------
next prev parent reply other threads:[~2003-07-26 17:08 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-07-26 14:52 Ada 0x, exception idea ? sk
2003-07-26 15:53 ` John R. Strohm
2003-07-26 17:08 ` sk
2003-07-26 17:08 ` sk [this message]
2003-07-27 2:46 ` Wesley Groleau
2003-07-27 16:35 ` Hyman Rosen
2003-07-27 9:10 ` Preben Randhol
[not found] <3F229597.3090909@myob.com>
2003-07-27 11:42 ` 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
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
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox