[erlang-questions] style question - best way to test multiple non-guard conditions sequentially

Anthony Ramine n.oxyde@REDACTED
Fri Jun 21 02:35:22 CEST 2013

Guard semantics are not mentioned in the documentation about comprehension filters though.

And I would rather have it removed than documented, but that's another story which I tell in another mail.

Anthony Ramine

Le 21 juin 2013 à 01:45, Richard A. O'Keefe a écrit :

> On 21/06/2013, at 4:27 AM, Jonathan Leivent wrote:
>> OK - that is surprising.  That certainly changes my thinking about if statements.  Is this particular semantic difference between guards and general conditions ever expressed in the reference manual?  If so, I certainly missed it.
> Yes it is.
> Section 7.24 "Guard Sequences", where guards are described.
> http://www.erlang.org/doc/reference_manual/expressions.html#id80042
> At the end, there is this sentence:
> 	If an arithmetic expression, a boolean expression, a short-circuit
> 	expression, or a call to a guard BIF fails (because of invalid
> 	arguments), the entire guard fails . If the guard was part of
> 	a guard sequence, the next guard in the sequence (that is, the
> 	guard following the next semicolon) will be evaluated.
> It's also explained clearly in the Erlang books I've read.

More information about the erlang-questions mailing list