<p>Am 02.02.2016 10:41 schrieb "Serguei TARASSOV" <<a href="mailto:serge@arbinada.com">serge@arbinada.com</a>>:<br>
><br>
> On 02/02/2016 10:29, <a href="mailto:fpc-pascal-request@lists.freepascal.org">fpc-pascal-request@lists.freepascal.org</a> wrote:<br>
>><br>
>> 2016-02-01 10:59 GMT+01:00 Michael Schnell<<a href="mailto:mschnell@lumino.de">mschnell@lumino.de</a>>:<br>
>> Same here. I see no reason to differ from it. Introducing new<br>
>> incompatibility is bad idea. For me is good to have booth (Oxygene<br>
>> compatible):<br>
>><br>
>> x := iif (a < 3, 1, 2);<br>
>> V := If a < 3 then 1 else 2;<br>
>><br>
>> sometimes is better to use first option and sometimes is better to use<br>
>> second option. Both Oxygen compatible and very "pascalish".<br>
><br>
> No, the second is always better because safer.<br>
><br>
> x := iif (Obj = nil, 0, Obj.Value);<br>
> This will raise access violation as a normal function or you depend on compiler implementation for this special case. And you should remember an additional special case of function.</p>
<p>That's why the current IfThen() is an intrinsic, to allow this.</p>
<p>> x := iif Obj = nil then 0 else Obj.Value;<br>
> Doesn't raise AV because it's a statement, not function.</p>
<p>It's not a statement, it's an expression. Also I won't introduce a new keyword ("iif") just for this.</p>
<p>Regards,<br>
Sven</p>