Am 02.02.2016 12:03 schrieb "Serguei TARASSOV" <se...@arbinada.com>: > > On 02/02/2016 11:42, fpc-pascal-requ...@lists.freepascal.org wrote: >> >> On Tue, 2 Feb 2016, Sven Barth wrote: >> >> >No, the second is always better because safer. >> > >> >x := iif (Obj = nil, 0, Obj.Value); >> >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. >> >> That's why the current IfThen() is an intrinsic, to allow this. > > Why make the things complex? Why create another "special case"? > Look at the "iif" as an statement and the things will be simple.
BECAUSE. IT. IS. *NOT*. A. STATEMENT! It never was and it never will be! It returns a value and thus by definition it is an expression! Regards, Sven
_______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal