[erlang-questions] Why I cannot use functions in gaurds

Bengt Kleberg bengt.kleberg@REDACTED
Tue Nov 6 08:01:26 CET 2012


Greetings,

Please read "7.24  Guard Sequences" in
http://www.erlang.org/doc/reference_manual/expressions.html. There is an
explanation about what is allowed as a guard.


bengt

On Tue, 2012-11-06 at 01:57 -0500, Maruthavanan Subbarayan wrote:
> HI,
> 
> 
> I would like to know  if the first one is valid why not the second
> one?
> 
> 
> case L of
>    {answer, N} when N == 42 -> true;
>    _ -> false
>  end.
> 
> 
> case L of
>    {answer, N} when N == M:F(A) -> true;
>    _ -> false
>  end.
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions




More information about the erlang-questions mailing list