Executing boolean expressions on a list

Richard Carlsson richardc@REDACTED
Tue Mar 18 11:35:07 CET 2003


----- Original Message ----- 
From: "Thomas Lindgren" <thomasl_erlang@REDACTED>

> Here is the behaviour I would expect, with A and B
> being expressions. Is it anything like what is
> implemented?
> 
> A andalso B =>
> case A of
>    true ->
>       case B of
>          true -> true;
>          false -> false;
>          Else -> exit(badarg)
>       end;
>    false -> false;
>    Else -> exit(badarg)
> end
> 
> And 'orelse' done in the same manner. 

Precisely so. And as I mentioned, I too think it would be far more
useful if the second expression was not checked.

> I haven't checked what is done today, but erl_lint
> should also complain about pattern matching in A or B
> (at the very least B, since variables exported from B
> are unsafe).

I think this was overlooked. Thanks.

    /Richard




More information about the erlang-questions mailing list