plain_fsm - for beginners and purists

Ulf Wiger ulf.wiger@REDACTED
Fri Feb 13 10:11:45 CET 2004

On Fri, 13 Feb 2004 08:29:58 +0100, Vlad Dumitrescu 
<vlad_dumitrescu@REDACTED> wrote:

> There is one more alternative that wasn't discussed yet:
> receive
>     .... %% nomal caluses
>     Msg ->
>         plain_fsm:handle(State, Msg)
> end;
> This is all plain Erlang, and nobody can misunderstand it. One possible 
> problem is that we can't have this handling before all other processing,
> but it doesn't feels like a big constraint. Are there other reasons, 
> Ulf? ;-)

Well, it forces the programmer to accept that messages not recognized by
the preceding clauses (which are not system messages) are summarily
discarded. In some cases, this is indeed what one wants, and then I'd
agree that it's a better solution. In other cases, it might well be
a disaster (possibly... I'm not totally convinced that handling of
system messages and discarding unexpected messages don't practically
always go together.)

I could include that as an alternative. It could complement the others.

Ulf Wiger, Senior System Architect

This communication is confidential and intended solely for the addressee(s). Any unauthorized review, use, disclosure or distribution is prohibited. If you believe this message has been sent to you in error, please notify the sender by replying to this transmission and delete the message without disclosing it. Thank you.

E-mail including attachments is susceptible to data corruption, interruption, unauthorized amendment, tampering and viruses, and we only send and receive e-mails on the basis that we are not liable for any such corruption, interception, amendment, tampering or viruses or any consequences thereof.

More information about the erlang-questions mailing list