[fpc-devel] Evaluation order in expressions
Jonas Maebe
jonas at freepascal.org
Tue Jul 30 08:55:48 CEST 2019
On 2019-07-30 08:23, Ondrej Pokorny wrote:
> can somebody comment on the Remark from
> https://www.freepascal.org/docs-html/ref/refch12.html ?
> _Remark: The order in which expressions of the same precedence are
> evaluated is not guaranteed to be left-to-right._
>
> Is this valid for boolean expressions, too?
Only if short circuit boolean evaluation is off.
> (Well it is no surprise because
> https://www.freepascal.org/docs-html/ref/refch12.html states that
> "_This behaviour is distinctly different from Delphi or Turbo
> Pascal._")
Delphi evaluates e.g. all parameters to subroutine calls from left to
right, which FPC does not guarantee.
Jonas
More information about the fpc-devel
mailing list