[fpc-devel] if-then-else expression

Ondrej Pokorny lazarus at kluug.net
Wed Aug 20 12:48:25 CEST 2025


On 01.02.2016 21:14, Sven Barth wrote:
> Hello together!
>
> Time for the next flame. I've attached a patch which implements an "if
> Condition then ThenExpr else ElseExpr"-expression for those that want to
> play around with it. It follows the same principles as the
> yet-to-be-renamed IfThen() (namely that the type is determined by the
> ThenExpr) as it's just a different syntax with the same (copy & pasted)
> code behind it...
>
> Note: this patch *might* also work with 3.0.0 or even 2.6.4...
>
> Regards,
> Sven

You were almost 10 years ahead :)

https://blogs.embarcadero.com/coming-in-rad-studio-13-a-conditional-ternary-operator-for-the-delphi-language/

Ondrej



More information about the fpc-devel mailing list