<div dir="auto"><div><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">Michael Van Canneyt via fpc-devel <<a href="mailto:fpc-devel@lists.freepascal.org">fpc-devel@lists.freepascal.org</a>> schrieb am Di., 2. Sep. 2025, 14:28:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
On Tue, 2 Sep 2025, Sven Barth via fpc-devel wrote:<br>
<br>
> Hairy Pixels via fpc-devel <<a href="mailto:fpc-devel@lists.freepascal.org" target="_blank" rel="noreferrer">fpc-devel@lists.freepascal.org</a>> schrieb am Di.,<br>
> 2. Sep. 2025, 09:50:<br>
><br>
>> On Sep 1, 2025 at 3:44:17 PM, Nikolay Nikolov via fpc-devel <<br>
>> <a href="mailto:fpc-devel@lists.freepascal.org" target="_blank" rel="noreferrer">fpc-devel@lists.freepascal.org</a>> wrote:<br>
>><br>
>>> You're more likely to see things like:<br>
>>><br>
>>> a := if x > 10 then 1 else -1;<br>
>>><br>
>>> instead of<br>
>>><br>
>>> if x > 10 then<br>
>>>   a := 1<br>
>>> else<br>
>>><br>
>>>   a := -1;<br>
>>><br>
>>><br>
>> Yes I agree but in C-like languages I do use it in function parameters<br>
>> just as often. Still feeling like IfThen if made a real intrinsic would be<br>
>> most readable and Pascal-like. Since this new expression exists now making<br>
>> the intrinsic would be extremely trivial.<br>
>><br>
><br>
> It doesn't matter whether it's trivial or not. An IfThen() intrinsic would<br>
> have a different behavior from *any* other function-like element and thus<br>
> would be a bad idea. Thus there will be *no* auch intrinsic.<br>
<br>
I don't think this is a good argument:<br>
<br>
Write(), Writeln, WriteStr and Str() are also intrinsics with "different<br>
behaviour" from all other function, intrinsic or not:<br>
<br>
The : formatting for one, and some arbitrarily limited varargs-like<br>
behaviour for another.<br>
<br>
Yet these are firmly entrenched in pascal.<br>
<br>
So at least on these grounds, the IfThen() has as much reason for existence as these<br>
"real pascal" functions, in my opinion.<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">But that's also not a reason that there should be more intrinsics that behave different from normal functions.</div><div dir="auto">Also none of these you mentioned have a behavior like the IfThen() intrinsic would have and some people might not even know that the parameters can be adjusted with the ":" syntax (or even if they do they might not need to use it; I don't know when I last used that for example), but for IfThen() that is a core part of the behavior. </div><div dir="auto"><br></div><div dir="auto">Regards, </div><div dir="auto">Sven </div><div dir="auto"><div class="gmail_quote gmail_quote_container"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
</blockquote></div></div></div>