[fpc-pascal] New feature: IfThen() intrinsic

Sven Barth pascaldragon at googlemail.com
Mon Feb 1 11:26:07 CET 2016


Am 01.02.2016 11:21 schrieb "Alexandrov Alexandru" <
alexandru.alexandrov at gmail.com>:
>
> IIf or IfThen (I opt for IIf) are trivial functions. The result of the
Math function must be the same as the System ones. Why do you care which
one apply?

Because there is a semantic difference. The new intrinsic works like an
if-statement in that only the branch that is taken is evaluated while for
all other IfThen() that exist up to now both branches will be evaluated.
Thus using one over the other can lead to changes in behavior, especially
if side effects (calling functions) are involved.

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20160201/9c6d65dd/attachment.html>


More information about the fpc-pascal mailing list