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.5 required=5.0 tests=BAYES_00,INVALID_MSGID, PP_MIME_FAKE_ASCII_TEXT autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,99222a5bd46ef3c9 X-Google-Attributes: gid103376,public From: Karel Th�nissen Subject: Re: GOTO considered necessary (reworked) Date: 1997/06/19 Message-ID: <33A8E9FE.76F1@hello.nl>#1/1 X-Deja-AN: 251083219 References: <5nn2fm$11dk$1@prime.imagin.net> <199706121410.QAA05823@basement.replay.com> <33A0840B.1B41@sprintmail.com> <33A58C79.1C7A@sprintmail.com> <33A8DB59.776F@hello.nl> Organization: Hello Technologies, Netherlands Newsgroups: comp.lang.ada Date: 1997-06-19T00:00:00+00:00 List-Id: Karel Th�nissen wrote: > A gizmo like this: > > gizmo State : (one, two, three); > -- the state variable is private to the gizmo (like loop indices) > -- the state variable is read-only, but can change (like loop > indices) > initialStuff; > transit one; > state one; > blaBlaTalk; > transit ....; > state two; > smallTalk; -- use State as a read-only variable like a loop index > transit ....; > state three; > fileBusterTalk; > terminate; -- or something of that kind; needs more braincells spent > end gizmo; Oops, the name of the state variable and the proposed reserved word for the state blocks are the same (except for Ada-irrelevant capitalisation)... It should read (also adding a type definition for the state variable to avoid an 'anonymous' type): type StateType is (one, two, three); gizmo StateVariable : StateType; -- StateVariable is private to the gizmo (like loop indices) -- StateVariable is read-only, but can change (like loop indices) initialStuff; transit one; -- goto initial state state one; ....; -- blocks can query StateVariable transit ....; state two; ....; -- transits can be burried like returns transit ....; state three; ....; terminate; -- or something of that kind end gizmo; > Groeten, Karel