ztellman / automat

better automata through combinators

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[feature request] signal function return several values

huahaiy opened this issue · comments

It is desirable for the signal function to return multiple values (a seq of candidates, for example), and the FSM would try and take the first value that can advance to the next state. This way, the signal become context sensitive, giving different interpretations depending on the state.

Would it be possible to add something like this? I looked at the code, it seems to be easy to add this functionality to the base compiler, but I do not seem to grok the eval compiler to be able to add it myself.

I'm sorry that it's taken me so long to get to this. I believe you're suggesting that the value from the signal be used as a (potential?) input to the FSM, which is not really the purpose of a signal. You could potentially use advance and the intermediate state to determine how to proceed next, but that's not something which needs to be in the core library.