<div dir="ltr">I cannot imagine of any situation where or and orelse work the same and reinstalling changes that. Please could you paste your exact code and shell session, showing the problem? Also, which version of Erlang are you using?<br>
<br><div class="gmail_quote">On Sat, Jul 19, 2008 at 10:51 AM, Sean Allen <<a href="mailto:sean@monkeysnatchbanana.com">sean@monkeysnatchbanana.com</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d"><br>
On Jul 19, 2008, at 10:47 AM, Edwin Fine wrote:<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
You are getting twisted in knots.<br>
<br>
1> X =0.<br>
0<br>
2> (X == 0) orelse (1/X > 2).<br>
true<br>
3> f().<br>
ok<br>
4> X = 1.<br>
1<br>
5> (X == 0) orelse (1/X > 2).<br>
false<br>
8> f().<br>
9> X = 0.<br>
0<br>
10> (X == 0) or (1/X > 2).<br>
** exception error: bad argument in an arithmetic expression<br>
in operator '/'/2<br>
called as 1 / 0<br>
<br>
So the orelse construct works as advertised. It will not evaluate any expressions after the first false condition and prevents divide by zero.<br>
</blockquote>
<br></div>
i need to reinstall because orelse doesnt for me. it works the exact same or.<br>
<br>
but assuming i get a working install the reason in the example that or fails is because of the divide by zero correct?<br>
<br>
which raises a new question...<br>
<br>
why does or evaluate all the conditions? what purpose does that serve? when would you use or instead of orelse?<br>
<br>
<br>
</blockquote></div><br><br clear="all"><br>-- <br>The great enemy of the truth is very often not the lie -- deliberate, contrived and dishonest, but the myth, persistent, persuasive, and unrealistic. Belief in myths allows the comfort of opinion without the discomfort of thought.<br>
John F. Kennedy 35th president of US 1961-1963 (1917 - 1963)
</div>