[erlang-questions] conditional expressions

David Mercer <>
Wed Nov 19 18:26:45 CET 2008


Richard Carlsson 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.)

Thanks for the reply, but I still do not understand.  If the first operand
evaluates to true the second operand must necessarily be checked, since they
both have to be true in order for the expression to evaluate to true.  What
am I missing (or mißing :-) )?

Cheers,

David




More information about the erlang-questions mailing list