<html><body><div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Dec 15, 2024 at 11:19:40 PM, Sven Barth <<a href="mailto:pascaldragon@googlemail.com">pascaldragon@googlemail.com</a>> wrote:<br></div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" type="cite">
It's not as if it is impossible to workaround this limitation:<br><br>=== code begin ===<br><br>program tpointerrec;<br><br>{$mode objfpc}<br>{$modeswitch advancedrecords}<br><br>type<br> generic TPointer<T> = record<br> type<br> PT = ^T;<br> end;<br><br> generic TFindNodeComparator<T> = function(item: specialize TPointer<T>.PT): Boolean;<br><br>
</blockquote>
</div>
<div><br></div><div dir="ltr">Yeah this works but look at this code now. I wasn’t there but I’m pretty sure the convention of “single names” for parameter types was for readability. There were no generics back then or even types in records so none of that would have been possible under their guidelines.</div><div dir="ltr"><br></div><div dir="ltr">That function header violates the entire their concept of readability also and is a worse offender than ^T and possibly even the inline proc type could be considered worse.</div><div dir="ltr"><br></div><div dir="ltr">generic function FindNode<T>(func: specialize TFindNodeComparator<T>): specialize TPointer<T>.PT;</div><div dir="ltr"><br></div><div dir="ltr">So the options are bad and worse, pick your poison. </div><div dir="ltr"><br></div><div dir="ltr"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Regards,</div> Ryan Joseph</div></div><br>
</div></body></html>