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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,e646052dc594401f,start X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,UTF8 Path: g2news1.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!usenet-fr.net!gegeweb.org!aioe.org!not-for-mail From: =?utf-8?Q?Yannick_Duch=C3=AAne_=28Hibou57?= =?utf-8?Q?=29?= Newsgroups: comp.lang.ada Subject: Strategies with SPARK which does not support exceptions Date: Thu, 17 Jun 2010 17:33:29 +0200 Organization: Ada At Home Message-ID: NNTP-Posting-Host: Ytbm1wnfaYrLLNPp/2uoww.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes Content-Transfer-Encoding: Quoted-Printable X-Complaints-To: abuse@aioe.org X-Notice: Filtered by postfilter v. 0.8.2 User-Agent: Opera Mail/10.53 (Win32) Xref: g2news1.google.com comp.lang.ada:11800 Date: 2010-06-17T17:33:29+02:00 List-Id: Hello, (This topic will probably not be the most exiting topic to some people).= When I use SPARK, or even when I don't use SPARK while I still have SPAR= K = design style in mind (even with Pascal which I still use), I have like a= ny = one else, to forget about exceptions. The only one thing which seems simple and clean enough I could figure, i= s = to use a Boolean variable, named =E2=80=9COK=E2=80=9D, and a sequence of= =E2=80=9Cif OK then=E2=80=9D = 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 =E2=80=9Cif OK then= =E2=80=9D which do = the same, and so on with next statements groups which are also wrapped i= n = a =E2=80=9Cif OK then=E2=80=9D (as many as needed). Although this seems clean and maintainable enough to me so far, I was = still wondering how other people deal with this (and may be by the way, = I = may have comment about why my way could be bad in some way). Note: a similar strategy may also obviously applies to fulfill the =E2=80= =9Conly = one single exit point=E2=80=9D requirement. So, let us talk and comment about design strategies in this area (if = someones wish to).