From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,e646052dc594401f X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,UTF8 Path: g2news2.google.com!news4.google.com!feeder.news-service.com!newsfeed.kamp.net!newsfeed.kamp.net!gegeweb.org!feeder.news.orange.fr!not-for-mail Date: Thu, 17 Jun 2010 21:54:35 +0200 From: Pascal Obry Organization: Home - http://www.obry.net User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; fr-FR; rv:1.8.1.22) Gecko/20090605 Thunderbird/2.0.0.22 Mnenhy/0.7.5.0 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Strategies with SPARK which does not support exceptions References: In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-ID: <4c1a7d49$0$2994$ba4acef3@reader.news.orange.fr> NNTP-Posting-Date: 17 Jun 2010 21:53:45 CEST NNTP-Posting-Host: 83.204.250.110 X-Trace: 1276804425 reader.news.orange.fr 2994 83.204.250.110:2260 X-Complaints-To: abuse@orange.fr Xref: g2news2.google.com comp.lang.ada:12779 Date: 2010-06-17T21:53:45+02:00 List-Id: Yannick, > The only one thing which seems simple and clean enough I could figure, > is to use a Boolean variable, named “OK”, and a sequence of “if OK then” > statements. That is, execution of one sequence of statements, which set > OK to False is something goes wrong, and execute clean-up statements by > the way. Then a next sequence of statements wrapped in a “if OK then” > which do the same, and so on with next statements groups which are also > wrapped in a “if OK then” (as many as needed). I don't understand. SPARK code cannot raise exception, so why should the code deal with exceptional code???? There is no exception, so not error to check... I don't see the point of the Ok variable. I'm probably missing something, can you clarify? Pascal. Hum, while writing this I see one case where this can be used... It is if exceptions are used as control flow. To me this is just very bad practice. -- --|------------------------------------------------------ --| Pascal Obry Team-Ada Member --| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE --|------------------------------------------------------ --| http://www.obry.net - http://v2p.fr.eu.org --| "The best way to travel is by means of imagination" --| --| gpg --keyserver keys.gnupg.net --recv-key F949BD3B