Perl Monk, Perl Meditation | |
PerlMonks |
Re^2: Multi-stage flip-flop?by RonW (Parson) |
on Dec 11, 2014 at 18:34 UTC ( [id://1110088]=note: print w/replies, xml ) | Need Help?? |
Relevant to sundialsvc4's comment "based only upon what it sees and upon the value of variables whose values can easily be printed", many textual state machine description syntaxes do not declare an explicit state variable. For example, in some dialects of Scheme, this:
defines a state machine equivalent to a Perl flip-flop. ("success" resets the state machine and returns true to the parent task.) In cond0 .. cond1 the states are anonymous, but cond0 is the "event" instigating the transition from the initial "inactive" state to the "active" state and cond1 is the event instigating the transition back to "inactive".
In Section
Meditations
|
|