<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2016-05-10 11:26 GMT+02:00 Anthony Walter <span dir="ltr"><<a href="mailto:sysrpl@gmail.com" target="_blank">sysrpl@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>Hey I'm all for your improvements. Good work, keep it up, and I actually appreciate it. If you want, I can write up an overview of your improvements at <a href="http://getlazarus.org" target="_blank">getlazarus.org</a> and provide precompiled versions for testings/use on all platforms (win, mac, linux, raspbian)..<br></div></blockquote><div> </div><div>glad to hear that ^^. I think is good idea to wait for smart pointers. I will let you know in PM.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"></div><div class="gmail_extra">Which probably isn't something you or anyone else has implemented yet because of the generic factor. Actually support for type helpers for any generic types (classes, records, interfaces, arrays) would be great, especially when combined with the work you've done on record initialization and finalization.</div></div></blockquote><div><br></div><div>With my private "not committed yet" version of compiler I can compile code like that (I think the good name for below construction is "specialized helper" or "forced helper" or just "record with default field"): <br></div></div><br></div><div class="gmail_extra">{ be aware that code below is experimental }<br></div><div class="gmail_extra">type<br> TManagedArray<T> = record<br> Instance: TArray<T> default;<br> <br> function Add(A: T): Integer; <br> end;<br> <br>function TManagedArray<T>.Add(A: T): Integer;<br>begin<br> Result := Length(Instance);<br> SetLength(Instance, Succ(Result));<br> Instance[Result] := A;<br>end; <br> <br>procedure foo(A: TArray<Integer>);<br>begin<br></div><div class="gmail_extra"> WriteLn(a[0]); // 10<br></div><div class="gmail_extra">end; <br> <br>var<br> a: TManagedArray<Integer>;<br> pa: ^TArray<Integer>;<br> i: Integer;<br>begin<br> a.Add(10);<br> i := a[0]; // compiler magic, equivalent of: i := a.Instance[0];<br> foo(a); // compiler magic, equivalent of: foo(a.Instance);<br> pa := @a; // compiler magic, equivalent of: pa := @a.Instance;<br> WriteLn(pa^[0], ' = ', i); // 10 = 10<br>end.<br clear="all"><br>-- <br><div class="gmail_signature"><div dir="ltr"><div>Best regards,<br>Maciej Izak</div></div></div>
</div></div>