<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2016-05-10 22:33 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 dir="ltr"><div class="gmail_extra">From your example code, the usage looks exactly like what I'd want. One question though. Would the magic code also work with var and out arguments?</div></div></blockquote><div><br></div><div>Yes.<br></div><div> </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">That is with (note these functions are generic):</div><div class="gmail_extra"><br></div><div class="gmail_extra">procedure Foo1<T>(A: TArray<T>);</div><div class="gmail_extra">procedure Foo2<T>(var A: TArray<T>);<br></div><div class="gmail_extra">procedure Foo3<T>(out A: TArray<T>);<br></div><div class="gmail_extra"><br></div><div class="gmail_extra">Where each can be called with a <span style="font-size:12.8px">TManagedArray<T> as the "A" argument without qualifying the Instance field?</span></div></div></blockquote><div><br></div><div>Yes, anyway example is buggy because we don't have "type inference" for generic methods/functions like in Java (which is on my TODO list), but is possible to compile and run example like this:<br></div><div> <br></div></div>var<br> a: TManagedArray<Integer>;<br>begin<br> Foo1<Integer>(a);<br> Foo2<Integer>(a);<br> Foo3<Integer>(a);<br></div><div class="gmail_extra"><br>-- <br><div class="gmail_signature"><div dir="ltr"><div>Best regards,<br>Maciej Izak</div></div></div>
</div></div>