<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 Sa., 6. Sep. 2025, 20:53:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
On Sat, 6 Sep 2025, Sven Barth via fpc-devel wrote:<br>
<br>
> michael via fpc-devel <<a href="mailto:fpc-devel@lists.freepascal.org" target="_blank" rel="noreferrer">fpc-devel@lists.freepascal.org</a>> schrieb am Do., 4.<br>
> Sep. 2025, 09:29:<br>
><br>
>> On 2025-09-04 08:55, Hairy Pixels via fpc-devel wrote:<br>
>>> On Sep 4, 2025 at 1:43:23 PM, michael 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>
>>>> Personally, I think we already have too much intrinsics to begin<br>
>>>> with;<br>
>>>> no matter their behaviour. But that is another discussion<br>
>>>> entirely...<br>
>>><br>
>>> How so? The reason intrinsics are used is because they can’t be<br>
>>> replicated at runtime. If you remove them then you lose that<br>
>>> functionality entirely.<br>
>><br>
>> As I wrote, for some it is needed. No arguments there.<br>
>><br>
>> But AFAIK many regular functions such as Length(), Inc/Dec() etc. are<br>
>> also converted to intrinsics.<br>
>><br>
>> No doubt for performance reasons, but I'd rather have as little as<br>
>> possible "compiler magic".<br>
>><br>
><br>
> Not performance reasons, but because they need to be usable by many types<br>
> and thus can't be expressed using ordinary Pascal in a typesafe way.<br>
<br>
Why inc() dec() cannot be expressed in a typesafe way ? <br>
We have InterlockedIncrement etc, and they do the same thing ?<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">Inc() and Dec() also work with enums which are custom types. </div><div dir="auto"><br></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">In each case, my point of view remains that the less intrinsics we have, the<br>
better it is.<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">I agree. Intrinsics should only be added when necessary. </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>