TEAM-ADA Archives

Team Ada: Ada Programming Language Advocacy

TEAM-ADA@LISTSERV.ACM.ORG

Options: Use Forum View

Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Pascal Obry <[log in to unmask]>
Reply To:
Pascal Obry <[log in to unmask]>
Date:
Thu, 23 Aug 2001 09:51:14 +0200
Content-Type:
text/plain
Parts/Attachments:
text/plain (32 lines)
Toshitaka KUMANO writes:
 > Such codes below are frequent in programs.
 >
 > if Found_Error then
 >    raise Some_Exception;
 > end if;
 > ...
 > if No_Need_Go_Further then
 >    return [Value];       --  function/procedure
 > end if;
 >

It seems nice but in real program I have rarely see this kind of code. In the
case of raise statement there is almost always some recovery code before the
raise and also more and more we use of Exceptions.Raise_Exception. In the case
of the return, there is often in a branch with some code before... Of course
if is always possible to add a boolean variable and use 'return ... when'...

Anyway that's my 2 cents :)

Pascal.

--

--|------------------------------------------------------
--| Pascal Obry                           Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--|         http://perso.wanadoo.fr/pascal.obry
--|
--| "The best way to travel is by means of imagination"

ATOM RSS1 RSS2