<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word">What you're missing is operator precedence [1] - "and" takes precedence over "<", so your guard clause ends up looking, to the runtime, like what Bengt pointed out - you have the boolean expression `is_inteteger(X) or is_float(X)` followed by and, followed by X - which is evaluated before the < operator. The evaluation of your guard looks something like this:<div><br></div><div>X = 1</div><div>(((is_integer(1) or is_float(1)) and 1) < 5</div><div><br></div><div>(((true) and 1) < 5)</div><div><br></div><div>`true and 1` cannot be evaluated (throws an exception, as `and` doesn't take integer arguments). Now, your guard expression threw an exception - what happens then:</div><div><br></div><div>"If an arithmetic expression, a Boolean expression, a short-circuit expression, or a call to a guard BIF fails (because of invalid arguments), the entire guard fails. If the guard was part of a guard sequence, the next guard in the sequence (that is, the guard following the next semicolon) is evaluated." [2]</div><div><br></div><div>So, your guard ends up not matching - you have no other function clauses, so you have "no function clause matching."</div><div><br></div><div>Make sense now?</div><div><br></div><div>Doug</div></div></blockquote><div><br></div><div>Thank you Doug. Yes - it makes sense. However operator precedence, which I previously checked, do not specify and & or:</div><div><a href="http://erlang.org/doc/reference_manual/expressions.html#prec">http://erlang.org/doc/reference_manual/expressions.html#prec</a></div><div><br></div><div>Therefore I assumed precedence was the same, and that is confusing. </div></div><br></div></div>