[fpc-pascal] New feature: IfThen() intrinsic
silvioprog
silvioprog at gmail.com
Mon Feb 1 19:23:37 CET 2016
On Mon, Feb 1, 2016 at 2:41 PM, Michael Van Canneyt <michael at freepascal.org>
wrote:
> On Mon, 1 Feb 2016, Maciej Izak wrote:
>
>> 2016-02-01 18:08 GMT+01:00 Jürgen Hestermann <juergen.hestermann at gmx.de>:
>>
>> From the above I would vote for "InlineIf" or eve better "IfThenElse".
>>>
>>>
>> InlineIf sounds better than IIF. Very suggestive and correct. IfThenElse
>> looks more like "Immediate IF" (or IfThen) functionality.
>>
>
> InlineIf is fine with me.
>
> As long as it doesn't require & or some other special constructs.
It would be nice if the programmer could choose it from some compiler
switch, something like:
{$define ifthendecl := InlineIf}
or:
{$define ifthendecl := iif} // my favourite :3
or:
{$define ifthendecl := &if}
And the default could be IfThen.
Another nice feature sould be:
Ifso().
S := Ifso(True, 'SomeValue'); // S = 'SomeValue'
S := Ifso(False, 'SomeValue'); // S = ''
Just an idea. :-D
--
Silvio Clécio
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20160201/a33ed3e0/attachment.html>
More information about the fpc-pascal
mailing list