and a SM manager, in 8th:
A SM is defined as simply as:
:: init init-action
-> a foo
-> b bar
:: foo foo-action
The states are defined after '::', as the name of the state and the word
to invoke when "sm:act" is invoked on the state-machine (in that state).
The transitions are defined with '->' and the name of the 'verb' causing
the transition, and the new state after the transition.
In this implementation, the last defined state is assumed as the target
of any transitions, until the next state is defined.
An advantage of this particular approach is that the actions don't need
to be defined before the state-machine is, as they are "found" at
runtime. A possible refinement would be to 'compile' the machine by
doing the action look-up once, prior to using the machine.
Transitions are effected with the word 'sm:next', and actions are
performed with 'sm:act'.