[erlang-questions] Erlang elseif
Richard O'Keefe
ok@REDACTED
Tue Nov 25 00:22:22 CET 2008
On 22 Nov 2008, at 8:13 pm, Jay Nelson wrote:
a lot that I agree with, but there is a sad irony:
> If you look at this code, the concept of branching on a condition
> is not represented.
Yes it is, and it's precisely branching on a full logical expression,
not a guard. This is precisely the kind of sort-of sort-of-not
havering which makes the present situation unstable: you CAN'T
use a true/false-valued full expression as a test in 'if', but
you CAN use one as a test in a list comprehension. I was
flabbergasted when I realised that that had been smuggled in.
It really is absurd to allow full Boolean-valued expressions
in list comprehensions but not in something like 'if'.
I have what I think are good reasons for finding the excess
power in list comprehensions lamentable rather than the limited
power of 'if', but it's hard to see how anybody could justify
the current mish-mash.
More information about the erlang-questions
mailing list