[fpc-devel] Proposal: IIF - IfThen Cond True False

Alexander Klenin klenin at gmail.com
Wed Jan 12 17:14:20 CET 2011


On Thu, Jan 13, 2011 at 00:51, Marc Weustink <marc.weustink at cuperus.nl> wrote:
>
> Note that there is a tiny little difference between those two.
>
> the ?: operator evaluates either the TruePart or FalsePart while IfThen will
> evaluate both parts first.

Exactly. This is why for me IfThen is much less useful then
conditional operators in other languages.
I think a better alternative would be Algol-like if-expression:
a := (if x > 0 then x else -x);

-- 
Alexander S. Klenin



More information about the fpc-devel mailing list