[erlang-questions] gen_statem state enter call and changing t oanother state

Frans Schneider fchschneider@REDACTED
Mon Jun 11 09:43:02 CEST 2018

Dear list,

the state_enter_result(State) has as one its return values {next_state, 
State, NewData, ...} but explicitly disallows the State to be different 
from the current State,  First, I find it confusing to allow 
'next_state' here since State cannot change but the name makes the 
suggestion it can. Secondly, I would love to be able to actually make a 
state change. Quite often i find myself running a few tests on entering 
a state and making state changes based on these tests. Now I have to 
move these tests to all states which can have this state as a result and 
go directly to the end state.

Would it be possible to change state from a state enter call?


More information about the erlang-questions mailing list