[erlang-questions] Proposal for new state machine engine: gen_statem

Bengt Kleberg <>
Fri Feb 19 17:17:34 CET 2016


Greetings,

I do [override | Ops], since the first one is picked.


bengt

On 02/19/2016 05:06 PM, Loïc Hoguin wrote:
> On 02/19/2016 04:43 PM, Raimo Niskanen wrote:
>> * If there are multiple transaction_option() in a state function return
>>    Ops, which one shall win, the first or the last? Currently the 
>> last wins to
>>    harmonize with that all Ops are executed in list order so the last 
>> one
>>    overrides the previous. This way you can not override a value by 
>> consing it
>>    to the head of Ops - you will have to append it instead, which is 
>> a bit
>>    uncommon.
>
> I believe that when being provided with a list of commands, the 
> commands should be run in order and therefore the last one should 
> always win. That a command overrides a previous command is perfectly 
> reasonable.
>
> I don't think the list of commands will ever get very big, so Ops ++ 
> [override] shouldn't be an issue. Sure ++ is uncommon, but overriding 
> is also uncommon, isn't it?
>




More information about the erlang-questions mailing list