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

Ingela Andin ingela.andin@REDACTED
Tue Jun 12 12:31:51 CEST 2018


Hi!

Could it be so that you are trying to solve the problem in the wrong place?
State enter actions are good for example starting a timer, but I think it
is illogical to change the state.
It sound to me like you could do so pattern matching, maybe in conjunction
with some guards in the your state function clauses and if your conditions
are meet maybe
all that clause does is to change state.

Regards Ingela Erlang/OTP team - Ericsson AB



2018-06-12 10:31 GMT+02:00 Frans Schneider <fchschneider@REDACTED>:

>
>
> On 06/12/2018 10:06 AM, Raimo Niskanen wrote:
>
>
>> I agree.  State enter calls were introduced to allow code to be run when a
>> state is entered, without having to duplicate that code at every state
>> exit
>> from the previous state.  It is a feature existing in other state machine
>> description languages e.g OpenBSD's ifstated.
>>
>> This is the exact reason for bringing up the whole issue. And sometimes,
> that requires a next_state NewState.
>
>>
>>
> Frans
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20180612/12845c2e/attachment.htm>


More information about the erlang-questions mailing list