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

Sven Barth pascaldragon at googlemail.com
Mon Feb 1 19:26:56 CET 2016


Am 01.02.2016 19:24 schrieb "silvioprog" <silvioprog at gmail.com>:
>
> 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

Don't complicate a simple feature like this even more -.-

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20160201/66f0a834/attachment.html>


More information about the fpc-pascal mailing list