<div dir="ltr">On 4 October 2017 at 13:41, Alex Blewitt <span dir="ltr">&lt;<a href="mailto:alblue@apple.com" target="_blank">alblue@apple.com</a>&gt;</span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word;line-break:after-white-space"><span><div><blockquote type="cite"><div>On 4 Oct 2017, at 11:42, Mike Kluev via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt; wrote:</div><div><div dir="ltr"><div class="gmail_extra"><br></div><div class="gmail_extra">speaking of &amp;&amp;, was it just a copy-paste from C or is there a more fundamental reason to use that instead of &amp;? in C they had to use two different operators because of the implicit int &lt;-&gt; bool promotions, but in swift &quot;true &amp; false&quot; vs &quot;1 &amp; 2&quot; would have been distinguishable.</div></div></div></blockquote><br></div></span><div>The difference between the &amp; and &amp;&amp; operators isn&#39;t to do with the implicit conversions; it&#39;s to do with whether both sides of the expression are evaluated or not.</div><div><br></div><div>false &amp;&amp; system(&#39;rm -rf&#39;)</div><div><br></div><div>You really don&#39;t want to do that if both sides are executed ...</div></div></blockquote><div><br></div><div>true. however what would stop the hypothetical &quot;logical &amp;&quot; operator to not evaluate the right hand side if the left </div><div>side is false similar to how &amp;&amp; behaves? yes, it would make it more different to the &quot;bitwise &amp;&quot; operator, but they are</div><div>already a bit different.</div><div><br></div><div>(it was always backwards to me even in C: bitwise *single* &amp; is for and-ing *multiple* bit pairs, whilst a</div><div>*multi-character* &amp;&amp; is for and-ing a single bool pair.)</div><div><br></div><div>Mike</div><div><br></div></div></div></div>