[fpc-pascal] New feature: IfThen() intrinsic
Sven Barth
pascaldragon at googlemail.com
Mon Feb 1 11:31:19 CET 2016
Am 01.02.2016 09:35 schrieb "David Butler" <djbutler at gmail.com>:
>
> This is usually called "inline if".
>
> Maybe call it "inlineif" or "iif", e..g
>
> x := iif (a < 3, 1, 2)
>
> or even
>
> x := iif a < 3 then 1 else 2;
I personally would have preferred "if a < 3 then 1 else 2", but a
discussion on fpc-devel a dew months ago has shown that there are quite
some against it... I myself am against a c-like operator like ?: and thus
the intrinsic came as a compromise.
Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20160201/5845cbce/attachment.html>
More information about the fpc-pascal
mailing list