<div dir="ltr">Ruby is less terse (I prefer to say more readable) and many of its idioms involve words.  <div>However, </div><div>a = !!b  assigns the boolean value of b, and</div><div>a ||= b assigns b to a only if a is nil or false</div><div>(at the risk of being less readable)</div><div><br></div><div>-Dan</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Feb 28, 2015 at 8:53 AM, Sean Walberg <span dir="ltr">&lt;<a href="mailto:sean@ertw.com" target="_blank">sean@ertw.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Thanks for pointing that out. TIL --&gt; which is another example of &quot;two operators smashed together does something cool&quot;. Too bad it doesn&#39;t work in Ruby, but it does in Perl:<div><br></div><div><div>$ perl -e &#39;$x=3; print &quot;hi\n&quot; while ($x --&gt; 0)&#39;</div><div>hi</div><div>hi</div><div>hi</div></div><div><br></div><div>Sean</div></div><div class="gmail_extra"><div><div class="h5"><br><div class="gmail_quote">On Sat, Feb 28, 2015 at 1:38 AM, Trevor Cordes <span dir="ltr">&lt;<a href="mailto:trevor@tecnopolis.ca" target="_blank">trevor@tecnopolis.ca</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I had to confirm what $x=!!$y meant in perl.  Remarkably, typing !! or<br>
&quot;!!&quot; or \!\! into google gives you nothing.  Had to use English.<br>
<br>
Got this:<br>
<br>
<a href="http://stackoverflow.com/questions/2168406/what-does-double-exclamation-point-mean" target="_blank">http://stackoverflow.com/questions/2168406/what-does-double-exclamation-point-mean</a><br>
<br>
The +42 answer is quite good.  Exec summary: !! is good for cleaning vars<br>
into 1 (true) or &#39;&#39; (false), which is important to keep warnings from<br>
complaining about undef vars.<br>
<br>
Anyhow, read the comments in the +42 answer.  Hehehe.<br>
<br>
Let the flamewars begin!<br>
_______________________________________________<br>
Roundtable mailing list<br>
<a href="mailto:Roundtable@muug.mb.ca" target="_blank">Roundtable@muug.mb.ca</a><br>
<a href="http://www.muug.mb.ca/mailman/listinfo/roundtable" target="_blank">http://www.muug.mb.ca/mailman/listinfo/roundtable</a><br>
</blockquote></div><br><br clear="all"><div><br></div></div></div><span class="HOEnZb"><font color="#888888">-- <br><div>Sean Walberg &lt;<a href="mailto:sean@ertw.com" target="_blank">sean@ertw.com</a>&gt;    <a href="http://ertw.com/" target="_blank">http://ertw.com/</a></div>
</font></span></div>
<br>_______________________________________________<br>
Roundtable mailing list<br>
<a href="mailto:Roundtable@muug.mb.ca">Roundtable@muug.mb.ca</a><br>
<a href="http://www.muug.mb.ca/mailman/listinfo/roundtable" target="_blank">http://www.muug.mb.ca/mailman/listinfo/roundtable</a><br>
<br></blockquote></div><br></div>