<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2014-03-24 10:38 GMT+09:00 Daniel Murphy <span dir="ltr"><<a href="mailto:yebbliesnospam@gmail.com" target="_blank">yebbliesnospam@gmail.com</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">"Kenji Hara" <<a href="mailto:k.hara.pg@gmail.com" target="_blank">k.hara.pg@gmail.com</a>> wrote in message news:mailman.27.1395624482.<u></u>25518.digitalmars-d@puremagic.<u></u>com...<div class="">
<br>
2014-03-24 10:09 GMT+09:00 bearophile <<a href="mailto:bearophileHUGS@lycos.com" target="_blank">bearophileHUGS@lycos.com</a>>:<br>
<br>
</div><div class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
    if (cond) exp1, exp2;   // in most case, this is not a bug.<br>
</blockquote>
<br></div>
It's not a bug, but this does the same thing - so why use the comma operator?<br>
<br>
if (cond) { exp1; exp2; }<br>
<br>
It catches bugs that are otherwise very difficult to spot. <br>
</blockquote></div><br></div><div class="gmail_extra"><div class="gmail_extra">At least I can imagine two reasonable cases.</div><div class="gmail_extra"><br></div><div class="gmail_extra">1. If the code is ported from C/C++, breaking it is not reasonable.</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">2. If the two expressions are strongly related, using comma operator is reasonable to represent the intensity. I think rather it's an *ability* to represent code meaning by using code style.</div>
<div><br></div><div>Kenji Hara</div></div></div>