I'm wondering if it would be useful to provide a way to have guards be kept out of the state machine, to keep it all "pure function".
The way I thought it might work would be to add a parameter to the transition
to specify the value of any guards. The guards would always be optional, but would of course influence the outcome. Here's a machine with a named guard (I use 'guard' instead of 'cond' because I like statechart terminology better than scxml):
m = Machine({
foo: {
on: {
A: bar,
B: {