<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">"Guard subexpressions resulting in a runtime error are treated as returning false"<br>


<br>
But with this function definition:<br>
<br>
-module(t1).<br>
-export([guard1/1]).<br>
<br>
guard1(N) when ((N/0 == 0) or N==1) -><br>
  hello.<br><br></blockquote><div> </div><div>In this example, the guard subexpression is the whole ((N/0 == 0) or N==1).</div><div><br></div><div>You can use , (meaning and) or ; (meaning or) to provide subexpressions:</div>

<div><br></div><div>    guard1(N) when N/0 == 0; N==1 -><br>      hello.</div><div><br></div><div>The example above should give you the expected result.</div></div>