comp.lang.ada
 help / color / mirror / Atom feed
* Strategies with SPARK which does not support exceptions
@ 2010-06-17 15:33 Yannick Duchêne (Hibou57)
  2010-06-17 17:11 ` Warren
                   ` (4 more replies)
  0 siblings, 5 replies; 22+ messages in thread
From: Yannick Duchêne (Hibou57) @ 2010-06-17 15:33 UTC (permalink / raw)


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 SPARK  
design style in mind (even with Pascal which I still use), I have like any  
one else, to forget about exceptions.

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).

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 “only  
one single exit point” requirement.

So, let us talk and comment about design strategies in this area (if  
someones wish to).



^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2010-06-30  8:17 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-17 15:33 Strategies with SPARK which does not support exceptions Yannick Duchêne (Hibou57)
2010-06-17 17:11 ` Warren
2010-06-17 18:19   ` Yannick Duchêne (Hibou57)
2010-06-21 13:31     ` Warren
2010-06-21 14:10       ` Alexandre K
2010-06-17 19:54 ` Pascal Obry
2010-06-17 22:47   ` Peter C. Chapin
2010-06-18  6:07 ` Claude
2010-06-18  8:06 ` Phil Thornley
2010-06-18  8:49   ` Martin
2010-06-18 17:16     ` mockturtle
2010-06-18 21:51       ` Alexandre K
2010-06-22 17:01   ` Phil Clayton
2010-06-22 23:14 ` Claude
2010-06-23 16:22   ` Warren
2010-06-24  3:24     ` Claude
2010-06-28 13:14       ` Warren
2010-06-29  8:39         ` Stephen Leake
2010-06-29 20:05       ` Randy Brukardt
2010-06-29 20:49         ` Georg Bauhaus
2010-06-30  5:08         ` Simon Wright
2010-06-30  8:17         ` stefan-lucks

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox