Compiler bug??

Vlad Dumitrescu <>
Tue Jul 4 19:52:15 CEST 2006


Hi,

> foo(X) ->
>    if
>        X > 1 ->
>            ok;       % <- Note semicolon here
>            not_ok;
>        true ->
>            true
>    end.

This is because "not_ok; true" is a valid guard expression and guards
have higher priority in the parser than the if clause....

Can be confusing, I agree.

best regards,
Vlad



More information about the erlang-questions mailing list