<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div><span style="background-color: rgba(255, 255, 255, 0);">Perfect - that fixed my head. Thanks.</span></div><div id="AppleMailSignature"><span style="background-color: rgba(255, 255, 255, 0);"><br></span></div><div id="AppleMailSignature"><span style="background-color: rgba(255, 255, 255, 0);">Date: Fri, 20 Nov 2015 22:16:52 -0800<br>From: Kenneth Lakin <<a dir="ltr" href="mailto:kennethlakin@gmail.com" x-apple-data-detectors="true" x-apple-data-detectors-type="link" x-apple-data-detectors-result="47">kennethlakin@gmail.com</a>><br>To: <a dir="ltr" href="mailto:erlang-questions@erlang.org" x-apple-data-detectors="true" x-apple-data-detectors-type="link" x-apple-data-detectors-result="48">erlang-questions@erlang.org</a><br>Subject: Re: [erlang-questions] guard clause oddity, maybe bug (in my<br> brain)?<br>Message-ID: <<a dir="ltr" href="mailto:56500C54.5060007@gmail.com" x-apple-data-detectors="true" x-apple-data-detectors-type="link" x-apple-data-detectors-result="49">56500C54.5060007@gmail.com</a>><br>Content-Type: text/plain; charset="windows-1252"</span></div><div id="AppleMailSignature"><span style="background-color: rgba(255, 255, 255, 0);"><br></span><span style="background-color: rgba(255, 255, 255, 0);">This seems a sensible way to look at it:<br><br>1> false andalso false orelse true.<br>true<br>2> ((false andalso false) orelse true).<br>true<br>3> (false andalso (false orelse true)).<br>false<br><br>andalso and orelse are described in the docs as<br><br>Expr1 orelse Expr2<br>Expr1 andalso Expr2<br><br>You *have* to have two expressions for a given andalso/orelse, so you<br>read expression 1 up there from left to right.<br>First evaluate<br>false andalso false (which is -obviously- false, and becomes the Expr1<br>of the next expression)<br>Then evalutate<br>false orelse true (which is true)<br><br>Does that make sense?<br></span><br>Sent from my iPad</div><div><br>On Nov 21, 2015, at 6:00 AM, <a href="mailto:erlang-questions-request@erlang.org">erlang-questions-request@erlang.org</a> wrote:<br><br></div><blockquote type="cite"><span>Date: Fri, 20 Nov 2015 22:16:52 -0800</span><br><span>From: Kenneth Lakin <<a href="mailto:kennethlakin@gmail.com">kennethlakin@gmail.com</a>></span><br><span>To: <a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a></span><br><span>Subject: Re: [erlang-questions] guard clause oddity, maybe bug (in my</span><br><span> brain)?</span><br><span>Message-ID: <<a href="mailto:56500C54.5060007@gmail.com">56500C54.5060007@gmail.com</a>></span><br><span>Content-Type: text/plain; charset="windows-1252"</span><br><span></span><br><blockquote type="cite"><span>On 11/20/2015 08:27 PM, Jim wrote:</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>Thank you both, I guess I don't fully understand the associative and precedence of these operators.</span><div style="display: none;"><br></div></blockquote><span></span><br><span>This seems a sensible way to look at it:</span><br><span></span><br><span>1> false andalso false orelse true.</span><br><span>true</span><br><span>2> ((false andalso false) orelse true).</span><br><span>true</span><br><span>3> (false andalso (false orelse true)).</span><br><span>false</span><br><span></span><br><span>andalso and orelse are described in the docs as</span><br><span></span><br><span>Expr1 orelse Expr2</span><br><span>Expr1 andalso Expr2</span><br><span></span><br><span>You *have* to have two expressions for a given andalso/orelse, so you</span><br><span>read expression 1 up there from left to right.</span><br><span>First evaluate</span><br><span>false andalso false (which is -obviously- false, and becomes the Expr1</span><br><span>of the next expression)</span><br><span>Then evalutate</span><br><span>false orelse true (which is true)</span><br><span></span><br><span>Does that make sense?</span><br></blockquote></body></html>