[fpc-pascal] New feature: IfThen() intrinsic

Marco van de Voort marcov at stack.nl
Tue Feb 2 10:38:20 CET 2016


In our previous episode, Maciej Izak said:
> *the best new name for "IfThen intrinsic" is iif*
> 
> unless someone has a good opposite arguments? Pros for iif:
> 
> - no conflicts with existing RTL code base (in this matter much much better
> than IfThen)
> - compatible with existing pascal solution (Oxygene)
> - short and logical name
> 
> Cons:
> - a little different behavior than in other languages (but still compatible
> with Oxygene)

How is it different behaviour from C then? The only practical application
that I see is in from C conversions (like ++ and --), so that you don't have
to rethink complex expressions that some @($*@$ thought up.

Of course one can find an use for any syntactic sugar, but then we should
give up making a pascal, and simply declare FPC as the superset of all
languages.

> - I like &if ;)

I don't see the point. And if a funky character is needed then use another
one, don't add a third overload to &. (statement to intrinsic instead of
statement to identifier and octal)





More information about the fpc-pascal mailing list