[erlang-questions] Order of evaluation of guards
Mon Jan 5 09:51:11 CET 2015
First of all - Happy New Year!
Suppose we have a function that accepts 2 integers and we want to react
only when both integers are greater than 0 and one of them is less than 100:
(dilbert@REDACTED)1> F = fun(N, M) when N > 0, M > 0, N < 100; M < 100
-> cool; (_, _) -> not_cool end.
The last is not correct.
What is the order of evaluation of the guards? Sadly parentheses are not
allowed in guards.
More information about the erlang-questions