[erlang-questions] Guards syntax for multiple values

Fred Hebert mononcqc@REDACTED
Wed Mar 27 12:01:23 CET 2019


On 03/27, Mikael Pettersson wrote:
>Instead of focusing on syntax, people should focus on semantics.
>
>The basic problem is the very presence of so-called "guard
>expressions", as a highly restricted subset of the general set of
>expressions.  The guard expression restriction is only needed in
>receives, to ensure that the mailbox doesn't change as a side-effect
>of evaluating the pattern match + guard combination.  In other
>contexts, guards could be fully general boolean expressions -- only
>historical reasons prevent them from being so.
>

Hot-code loading could also lead to weird effects where you could not 
only have recursive guards, but guards whose meaning changes during 
clause evaluation and could give really funky results when you consider 
that the compiler reserves rights to modify clause order.



More information about the erlang-questions mailing list