<div dir="ltr"><div class="gmail_default" style="font-size:large">Then, I would suggest it gets bolted into strutils, or sysutils. There are many good reasons to optimize Setlength(), especially for script authors :-)<br><br></div><div class="gmail_default" style="font-size:large">Currently, I am working (learning) Alpha Controls (alphaskins), and trying to find a fit into FCL/LCL, or Graeme's GUI. And if I tweak too much, things forget to draw - so I understand avoiding "core" bloat. But, Isn't that what SYSUTILs is for :-)<br></div><div class="gmail_default" style="font-size:large"><br></div><div class="gmail_default" style="font-size:large">Ozz<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Sep 16, 2020 at 11:33 PM J. Gareth Moreton via fpc-devel <<a href="mailto:fpc-devel@lists.freepascal.org">fpc-devel@lists.freepascal.org</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">Ah yes, that works, thanks.<br>
<br>
I feel a bit silly because I haven't explored these useful features as <br>
much as I should, possibly because assembly language isn't object oriented!<br>
<br>
I think the difficulty with getting things like this approved is that it <br>
crosses into the realm of defining the language itself. I can't say I <br>
speak on behalf of Florian or Jonas, but I sense they want to avoid <br>
feature bloat that became a bit of an issue with Delphi.<br>
<br>
Gareth aka. Kit<br>
<br>
On 17/09/2020 04:03, Ryan Joseph via fpc-devel wrote:<br>
><br>
>> On Sep 17, 2020, at 9:59 AM, J. Gareth Moreton via fpc-devel <<a href="mailto:fpc-devel@lists.freepascal.org" target="_blank">fpc-devel@lists.freepascal.org</a>> wrote:<br>
>><br>
>> type generic TMyArray<T> = record<br>
>> Data: ^T;<br>
>> Length: PtrUInt;<br>
>> end;<br>
>><br>
>> The compiler will complain about T being an unresolved forward declaration. Outside of specifying a second parameter for the pointer type (which would be a little unfriendly for third-party users), there isn't really a way around this.<br>
>><br>
> To be clear all the features work but it's not as optimized as dynamic arrays and could be cumbersome with arrays of records.<br>
><br>
> I think you're supposed to redeclare a pointer to T:<br>
><br>
> type generic TMyArray<T> = record<br>
> type<br>
> TP = ^T;<br>
> public<br>
> Data: TP;<br>
> Length: PtrUInt;<br>
> end;<br>
><br>
><br>
> Regards,<br>
> Ryan Joseph<br>
><br>
> _______________________________________________<br>
> fpc-devel maillist - <a href="mailto:fpc-devel@lists.freepascal.org" target="_blank">fpc-devel@lists.freepascal.org</a><br>
> <a href="https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel" rel="noreferrer" target="_blank">https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel</a><br>
><br>
<br>
-- <br>
This email has been checked for viruses by Avast antivirus software.<br>
<a href="https://www.avast.com/antivirus" rel="noreferrer" target="_blank">https://www.avast.com/antivirus</a><br>
<br>
_______________________________________________<br>
fpc-devel maillist - <a href="mailto:fpc-devel@lists.freepascal.org" target="_blank">fpc-devel@lists.freepascal.org</a><br>
<a href="https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel" rel="noreferrer" target="_blank">https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel</a><br>
</blockquote></div>