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=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,99222a5bd46ef3c9 X-Google-Attributes: gid103376,public From: "John G. Volan" Subject: Re: GOTO considered necessary (reworked) Date: 1997/06/23 Message-ID: <33AE23A3.74E1@sprintmail.com>#1/1 X-Deja-AN: 251960181 References: <5nn2fm$11dk$1@prime.imagin.net> <199706121410.QAA05823@basement.replay.com> <33A0840B.1B41@sprintmail.com> <33A58C79.1C7A@sprintmail.com> Organization: Sprint Internet Passport Reply-To: johnvolan@sprintmail.com Newsgroups: comp.lang.ada Date: 1997-06-23T00:00:00+00:00 List-Id: Robert Dewar wrote: > > As for fall through, that is quite a bogus argument. If you map a FSM into > a loop/case structure with an explicit state variable, then you have to be > equally careful not to forget to modify the state variable. The error in one > case is accidental transition to the following state, the error in the other > is an infinite loop in one state -- not much to call there. > > Of course in practice, one of the advantages of the goto model is that in > some cases, it is quite natural to fall through to the following state: [snip example of intentional fall-through] Of course, what I was referring to was unintended or accidental fall-through, particularly when introduced inadvertently during maintenance. As you and others have pointed out, there are ways to defensively guard against this whether programming a FSM using loop+case or code+goto. ------------------------------------------------------------------------ Internet.Usenet.Put_Signature (Name => "John G. Volan", Employer => "Texas Instruments Advanced C3I Systems, San Jose, CA", Work_Email => "jvolan@ti.com", Home_Email => "johnvolan@sprintmail.com", Slogan => "Ada95: World's *FIRST* International-Standard OOPL", Disclaimer => "My employer never defined these opinions, so using" & "them would be totally erroneous ... or is that" & "just nondeterministic behavior now? :-) "); ------------------------------------------------------------------------