clj-statecharts
clj-statecharts copied to clipboard
Clarify EventLess Transitions documentation
The documentation on EventLess Transitions describes very well what happens when in state :s1, event :e12 happens and either guard23 or guard24 return true. If they are not true, it just says "Otherwise it would stay in :s2."
What exactly happens in this case? Will :always be evaluated again when the next event arrives while the machine is still in :s2? Specifically:
- What happens if we are in state
:s2and event:e23happens? - What happens if we are in state
:s2and another event (that is not:e23) happens?
Right now the :always part is only evaluated when entering the state it's defined in. i.e. :s2 in the example used in the documentation.
Looks like in the statecharts specification, the :always part shall be evaluated for any event, as long as the machine is in that state.
https://statecharts.dev/glossary/automatic-transition.html
Automatic transitions are usually guarded. Such a guarded automatic transition is checked immediately after the state is entered. If the condition doesn’t hold then the machine remains in the state, with this automatic transition in play for as long as the state is active. Every time the statechart handles an event, the guard condition for these automatic transitions are checked. If the guard condition ever succeeds, then the transition happens.
I'll fix this part to comply with the standard.