« Return to Thread: comma vs andalso

Re: comma vs andalso

by Richard Carlsson-2 :: Rate this Message:

Reply to Author | View in Thread

Roberto Ostinelli wrote:
> let me point another (and correct) example then:
>
> foo(..) when X =/= 0 andalso 1/X > 0.1 -> ..
>
> the following expression would fail instead:
>
> foo(..) when X =/= 0, 1/X > 0.1 -> ..

Aye, but an exception in a guard test is always caught and
treated as if the test evaluated to "false". In this example,
there is no observable difference between the two.

   /Richard


________________________________________________________________
erlang-questions mailing list. See http://www.erlang.org/faq.html
erlang-questions (at) erlang.org

 « Return to Thread: comma vs andalso