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

Richard A. O'Keefe ok@REDACTED
Fri Jun 21 03:34:53 CEST 2013


On 21/06/2013, at 12:35 PM, Anthony Ramine wrote:

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

Fair enough.  And I'm not the least little bit happy about the fact
that comprehension filters aren't guards.

I would have expected
	'[' <expr> '||' <stuff> ']'
where
	<stuff> ::= <stuff> ',' <stuff>
	         |  <pattern> '<-' <expression>
	         |  <pattern> '=' <expression>
	         |  <possibly parenthesised guard>

We can tolerate a thing being one way (X < Y is only a guard, and if X or Y
raises an exception, it just fails) or all the other way (guards and
expressions are identical), but a mixture is bound to confuse.




More information about the erlang-questions mailing list