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,b45952e5dedb7e9a X-Google-Attributes: gid103376,public From: dewar@merv.cs.nyu.edu (Robert Dewar) Subject: Re: State Machine Implementation Date: 1998/08/06 Message-ID: #1/1 X-Deja-AN: 378520141 References: <35C90369.CFE8ED98@inficad.com> X-Complaints-To: usenet@news.nyu.edu X-Trace: news.nyu.edu 902413682 27275 (None) 128.122.140.58 Organization: New York University Newsgroups: comp.lang.ada Date: 1998-08-06T00:00:00+00:00 List-Id: <> A case statement is possible certainly, and it is hard to know exactly what you mean by "an implementation", since this is the sort of thing that occurs all the time in a programs, and the application dependent details are 95% of the code anyway. Note that an alternative, probably more efficient, and for many people more readdable way of coding a finite state machine in languages like Ada is to use a label on each state, and goto's to effect state transition, thus efficiently encoding the state in the program counter. Some people have this silly allergy to goto's (a case of understanding an important principle without really understanding it), but in fact this is for many programmers one of the very few legitimate uses of gotos.