[fpc-devel] if-then-else expression
    Sven Barth 
    pascaldragon at googlemail.com
       
    Tue Sep  2 14:13:14 CEST 2025
    
    
  
Hairy Pixels via fpc-devel <fpc-devel at lists.freepascal.org> schrieb am Di.,
2. Sep. 2025, 09:50:
> On Sep 1, 2025 at 3:44:17 PM, Nikolay Nikolov via fpc-devel <
> fpc-devel at lists.freepascal.org> wrote:
>
>> You're more likely to see things like:
>>
>> a := if x > 10 then 1 else -1;
>>
>> instead of
>>
>> if x > 10 then
>>   a := 1
>> else
>>
>>   a := -1;
>>
>>
> Yes I agree but in C-like languages I do use it in function parameters
> just as often. Still feeling like IfThen if made a real intrinsic would be
> most readable and Pascal-like. Since this new expression exists now making
> the intrinsic would be extremely trivial.
>
It doesn't matter whether it's trivial or not. An IfThen() intrinsic would
have a different behavior from *any* other function-like element and thus
would be a bad idea. Thus there will be *no* auch intrinsic.
Regards,
Sven
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20250902/4aa979f2/attachment.htm>
    
    
More information about the fpc-devel
mailing list