From: "Yannick Duchêne (Hibou57)" <yannick_duchene@yahoo.fr>
Subject: Re: best practice: error handling
Date: Sat, 11 Jun 2011 15:38:10 +0200
Date: 2011-06-11T15:38:10+02:00 [thread overview]
Message-ID: <op.vwwytws4ule2fv@douda-yannick> (raw)
In-Reply-To: op.vwcvgefflzeukk@jellix.jlfencey.com
Le Tue, 31 May 2011 19:13:16 +0200, Vinzent Hoefler
<0439279208b62c95f1880bf0f8776eeb@t-domaingrabbing.de> a écrit:
> If you kind of expect the call to fail under normal conditions, a proper
> out-Parameter (like "Success" ;) can be added.
>
> Keep in mind, that returning some error requires a function, and until
> now
> functions can't have "out"-parameters, so returning an "error code" is
> only
> possible for those subroutines which do not need to have
> "out"-parameters.
I strongly suspect this is precisely the reason why Ada 2012 will add out
parameters to function ;)
First, I though this was a silly idea, and later, from time to time, I
though this was indeed a good idea, at least to return status from
function, without the need to define wrapper types every where (at least,
while Ada do not have provision to return proper tuples like functional
languages do). Moreover, a function may still be conceptually Pure, even
with out parameters ;)
--
“Syntactic sugar causes cancer of the semi-colons.” [Epigrams on
Programming — Alan J. — P. Yale University]
“Structured Programming supports the law of the excluded muddle.” [Idem]
“c++; /* this makes c bigger but returns the old value */” [Anonymous]
next prev parent reply other threads:[~2011-06-11 13:38 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-31 14:01 best practice: error handling milouz
2011-05-31 17:13 ` Vinzent Hoefler
2011-05-31 17:57 ` AdaMagica
2011-06-11 13:38 ` Yannick Duchêne (Hibou57) [this message]
2011-05-31 18:08 ` Jeffrey Carter
2011-05-31 20:02 ` Dmitry A. Kazakov
2011-05-31 20:35 ` Jeffrey Carter
2011-05-31 21:40 ` Dmitry A. Kazakov
2011-06-11 13:57 ` Yannick Duchêne (Hibou57)
2011-06-11 14:07 ` Dmitry A. Kazakov
2011-06-12 5:19 ` Randy Brukardt
2011-06-11 13:48 ` Yannick Duchêne (Hibou57)
2011-06-11 13:31 ` Yannick Duchêne (Hibou57)
2011-06-11 16:12 ` Simon Wright
2011-06-11 16:26 ` Dmitry A. Kazakov
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox