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

Michael Van Canneyt michael at freepascal.org
Mon Feb 1 11:12:38 CET 2016



On Mon, 1 Feb 2016, Maciej Izak wrote:

> 2016-02-01 10:42 GMT+01:00 Michael Van Canneyt <michael at freepascal.org>:
>
>> Sven took the best possible route by making it an
>> identifier of the system unit. The refactoring argument is nonsense, as it
>> applies to ANY identifier, not just this one.
>>
>> We can discuss IIF or IfThen, but the same applies for IIF.
>
>
> You are kidding me?

No ?

>
> You can never be sure what you use. When is used Math or StrUtils I need to
> use System.IfThen. O___o
>
> *The decision Sven is wrong.*

Two can play at this game :)

*your argument means the system unit cannot be changed _ever again_*

The scope rules apply for this just as it does for any other. The modes are
based on this rule by inserting - behind your back - the objpas unit in the
uses clause which does in essence the same.

As I said, I don't care about the actual name.

I personally would have used IIF(): 
I have a unit fpiif which contains a bunch of iif overloads, so my 
life would certainly be easier if Sven had used that ;)

Michael.



More information about the fpc-pascal mailing list