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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fac41,f66d11aeda114c52 X-Google-Attributes: gidfac41,public X-Google-Thread: 103376,f66d11aeda114c52 X-Google-Attributes: gid103376,public From: eachus@spectre.mitre.org (Robert I. Eachus) Subject: Re: Building blocks (Was: Design By Contract) Date: 1997/10/17 Message-ID: #1/1 X-Deja-AN: 281349838 References: <34316EC3.5B62@dynamite.com.au> <199710011402.QAA02444@basement.replay.com> <3432788C.E35@uk.ibm.com> <5w3FnzA6KRR0Iwt+@treetop.demon.co.uk> <34467890.243549EE@munich.netsurf.de> Organization: The Mitre Corp., Bedford, MA. Newsgroups: comp.lang.ada,comp.lang.eiffel Date: 1997-10-17T00:00:00+00:00 List-Id: In article <34467890.243549EE@munich.netsurf.de> Joachim Durchholz writes: > Fie, what's this! Exceptions used for flow control... No, a code fragment where errors are explicitly handled. If you examine the code more closely you will notice that the inner loop has an exit statement associated with accepting valid input. You go around that loop again if you have bad input. ONE of the ways to end up rerunning the input loop is if you handle an exception, there are usually several others. This is a common idiom. Now in Ada, it may be right to avoid using exceptions for flow control, but that doesn't mean you should throw the exceptions on the floor or ignore them. And once you handle the error, of course you want to return to the proper state. So any well implemented state machine in Ada will have exception handlers, and even gotos in some of them. But it doesn't mean that that path is expected to be taken outside of testing. -- Robert I. Eachus with Standard_Disclaimer; use Standard_Disclaimer; function Message (Text: in Clever_Ideas) return Better_Ideas is...