[erlang-questions] Guards?

Roberto Ostinelli roberto@REDACTED
Tue Apr 5 14:34:00 CEST 2016


On Tue, Apr 5, 2016 at 2:30 PM, Bengt Kleberg <bengt.kleberg@REDACTED>
wrote:

> For F, did you mean:
> ((is_integer(X) or is_float(X)) and X) < 5
>

Not really, no :)

1> F = fun(X) when ((is_integer(X) or is_float(X)) and X) < 5 -> ok end.
#Fun<erl_eval.6.50752066>
13> F(1).
** exception error: no function clause matching
erl_eval:'-inside-an-interpreted-fun-'(1)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20160405/92939149/attachment.htm>


More information about the erlang-questions mailing list