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: 103376,deeb88b0e7eede4f X-Google-Attributes: gid103376,public From: "Theodore E. Dennison" Subject: Re: Help with Exceptions! Date: 1996/05/14 Message-ID: <31987FF6.2781E494@escmail.orl.mmc.com>#1/1 X-Deja-AN: 154750389 references: <4mmimq$s4r@hatathli.csulb.edu> <318F94D9.35AB@io.com> content-type: text/plain; charset=us-ascii organization: Lockheed Martin Information Systems mime-version: 1.0 newsgroups: comp.lang.ada x-mailer: Mozilla 2.0 (X11; I; SunOS 4.1.3_U1 sun4m) Date: 1996-05-14T00:00:00+00:00 List-Id: Robert I. Eachus wrote: > > In article <319764DA.3A8C@io.com> Dave Jones writes: > > > Most others seem to have an experience similar to mine: "goto" > > means you need to change your approach. So I was wondering, has > > anyone out there ever encountered a situation where "goto" was > > actually necessary? > > The only two cases in which I have used gotos in are: > > 1) Testing the compiler's implementation of gotos for correctness. > > 2) Implementation of table driven finite-state machines. > > The latter requires a bit of explanation. Machine generated FSMs > can use lots of gotos, but I have never seen an Ada FSM generator > which does that. Implementing the entire FSM by hand with gotos is > heap bad juju. But often you want a state table entry to have the This question came up here about a year ago (inadvertantly raised by myself), and kicked up quite a ---- storm. I think the general consensus at the end was that there are situations where a FSM algorithm may be implemented more clearly with goto's that without. Personally, I'd rather write the unclear non-goto code. The Goto is one genie I'm not about to release from the bottle. However, I remember vividly the ferocity of Robert Dewar's arguments in favor of goto's for FSM's in compilers. Thus I'd be willing to wager that if you look through GNAT's source code, you will find gotos. I don't KNOW this, its just a (perhaps poorly) edjucated guess on my part. -- T.E.D. | Work - mailto:dennison@escmail.orl.mmc.com | | Home - mailto:dennison@iag.net | | URL - http://www.iag.net/~dennison |