<div dir="auto"><div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Ryan Joseph via fpc-pascal <<a href="mailto:fpc-pascal@lists.freepascal.org">fpc-pascal@lists.freepascal.org</a>> schrieb am So., 10. Nov. 2019, 02:11:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
> On Nov 7, 2019, at 12:28 PM, Ben Grasset via fpc-pascal <<a href="mailto:fpc-pascal@lists.freepascal.org" target="_blank" rel="noreferrer">fpc-pascal@lists.freepascal.org</a>> wrote:<br>
> <br>
>   {$IF GetTypeKind(T) in [tkInteger, tkInt64, tkQWord]}<br>
>     Result := A div B<br>
>   {$ELSEIF GetTypeKind(T) = tkFloat}<br>
>     Result := A / B<br>
>   {$ELSE}<br>
>     Result := Default(T);<br>
>   {$ENDIF}<br>
<br>
This is what I hinted in my post.  Has anything like this been considered before? It seems necessary to me but it looks like Sven had some fancy work around using pointers. Either way the compile time directive would be faster and avoid the conditional statements.<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">The token recorder does not support preprocessor conditions. Not to mention that this mixes preprocessor and parser stuff. Generics are part of the parser. </div><div dir="auto"><br></div><div dir="auto">Regards, </div><div dir="auto">Sven </div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
</blockquote></div></div></div>