<div dir="auto"><div><div class="gmail_quote"><div dir="ltr">Am So., 27. Jan. 2019, 00:01 hat John Doe <<a href="mailto:slightlyoutofphase@gmail.com">slightlyoutofphase@gmail.com</a>> geschrieben:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Not the right person to give a qualified answer to your question, but bare record parameters in method signatures are kind of a problem throughout various parts of the standard FPC and Lazarus libraries, I've noticed.<div><br></div><div>It almost makes me think the either the compiler should perform the kind of optimization it does with const/var/constref implicitly no matter what, or it should just not allow you to specify methods without them at all. What's the point in having a way of doing something that is guaranteed to always give worse results than all of the other ways? It seems pointless.</div></div></blockquote></div></div><div dir="auto"><br></div><div dir="auto">No, the default by-value passing has its uses. With "const" and "constref" one can't modify the record and one needs to make a copy to do so and with "var" one always changes the passed in reference so one needs a copy if one does not want that. </div><div dir="auto">Changing this behavior would not only be a backwards incompatibility, but would also violate the ABI which describes how records shall be passed. And if it says copy then it shall get copy ("var" and "constref" are essentially pointers and "const" puts the decision to the compiler and is not part of the system ABI anyway). </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>