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

Sven Barth pascaldragon at googlemail.com
Tue Feb 2 14:33:40 CET 2016


Am 02.02.2016 13:38 schrieb "Andreas Berger" <Andreas at thebergerclan.org>:
>
>
> On Tue 02/02/2016 09:27, Jonas Maebe wrote:
>>
>>
>> The parameter evaluation order issue is irrelevant in this context:
Delphi guarantees left-to-right (or used to anyway, this may have changed),
FPC doesn't guarantee anything.
>>
> Wow, what's this? I never knew this. I have been using Borland products
since TP 1.0 and for me left-to-right is automatic, I don't even think
about it. If FPC doesn't guarantee this my code is full of potential
problems.
> BTW using left-to-right does not mean non-robust code if it is guaranteed.

FPC indeed does not guarantee the evaluation order (and that's even
documented AFAIK). It might change the evaluation order to generate better
code. It only guarantees that each parameter is evaluated exactly once
(though in case of expressions without calls it might reuse results in
certain optimization settings, I don't know that currently though) and that
the parameters are passed in the correct order.

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


More information about the fpc-pascal mailing list