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

Michael Schnell mschnell at lumino.de
Tue Feb 2 10:48:03 CET 2016


On 02/02/2016 10:31 AM, Graeme Geldenhuys wrote:
> Exactly! I'm glad somebody noticed that too.

Of course I did notice :-) .

V := If a < 3 then 1 else 2;

In fact extends a several language paradigms:

   - a keyword (such as "if") returns a value
   - a statement (such as "if ....", and the content of an if clause ) 
returns a value
   - an expression (such as "1") is accepted as a statement (and hence 
allowed in a n if clause)

This _might_ be viable and doable, as its a pure optional extension.

-Michael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20160202/5d0c9656/attachment.html>


More information about the fpc-pascal mailing list