[erlang-questions] conditional expressions

Bjorn Gustavsson bgustavsson@REDACTED
Wed Nov 19 18:24:46 CET 2008


On Wed, Nov 19, 2008 at 4:28 PM, Richard Carlsson <richardc@REDACTED> wrote:
> David Mercer wrote:
>> Can someone please explain the tail recursion problem with andalso?  Thanks.
>
> It checks that the return value of the right hand side is a boolean,
> so it must wait for the evaluation to return; it can't just do a tail
> call if the left hand side evaluates to true. (The OTP folks thought
> that error checking was more important than tail recursion for these
> operators.)

Maybe we should reconsider that decision for R13.

I agree with Mikael that andalso/orelse are both useless and dangerous.

/Bjorn
-- 
Björn Gustavsson, Erlang/OTP, Ericsson AB



More information about the erlang-questions mailing list