<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2016-02-02 13:12 GMT+01:00 Michael Van Canneyt <span dir="ltr"><<a href="mailto:michael@freepascal.org" target="_blank">michael@freepascal.org</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">"iif(a,b,c)<br>
is fundamentally different in behaviour from<br>
functionxyy(a,b,c)"<br>
<br>
simply laughable in my eyes, because likely 99,99% of programmers won't know the<br>
difference. As Graeme said: 'I guess I was just lucky it never happened to me'.<br>
That sums it up.<br>
<br>
I'm just trying to to put any foaming-at-the-mouth argumentation using this particular argument in perspective.<br>
<br>
For a correct understanding: The compiler must behave predictable at all<br>
times, no arguing there. But I don't think that iif() having different<br>
semantics than all other functions, is a problem. It just needs to be<br>
documented properly. It is a non-issue for me.<br>
<br>
To give more perspective:<br>
The same is true for Writeln() and Assert(), which also have are different<br>
semantics, but this difference is simply documented (if at all).<br>
I didn't hear anyone protesting that. The fact that it is so in the pascal<br>
standard doesn't make a iota of difference; the standard was most likely simply made after the facts.</blockquote><div><br></div><div>+1 well said.</div><div><br></div><div><div>profit of different behavior for iif is huge:</div><div><br></div><div>x := iif(obj = nil, 0, obj.foo);</div><div><br></div><div>and as was stated many times, this behavior iif is *compatible with existing Oxygene* (!). Finally some compatible part.</div><div><br></div><div>maybe is worth to implement additional IfThen intrinsic (just generic version of regular method from Math/StrUtils.IfThen)</div></div></div><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div>Best regards,<br>Maciej Izak</div></div></div>
</div></div>