[fpc-devel] if-then-else expression
Sven Barth
pascaldragon at googlemail.com
Sat Aug 23 09:17:52 CEST 2025
Ondrej Pokorny via fpc-devel <fpc-devel at lists.freepascal.org> schrieb am
Do., 21. Aug. 2025, 23:49:
> 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/
Oxygene already had it for longer which is where I had the idea from 😅
Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20250823/1d565bd6/attachment.htm>
More information about the fpc-devel
mailing list