<div dir="auto"><div class="gmail_quote" dir="auto"><div dir="ltr">Am So., 27. Jan. 2019, 02:53 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"><div dir="ltr"><div dir="ltr">However, I'm also quite simply unaware of any specific realistic scenario where I would *ever* specify a un-prefixed record in a method (in my own projects for example I actually haven't used anything but "var" and "constref" for years, not even just normal const as it doesn't always "do the trick" I've found), and I do think that on a more broad scope it is highly unlikely that most existing record methods written in an "unprefixed" fashion were done that way for any particular or intentional reason.</div></div></div></blockquote></div><div dir="auto"><br></div><div dir="auto">As I suggested in my answer one situation is interfacing with non-Pascal code. </div><div dir="auto">Also there is another side effect that at least needs to be kept in mind: if you have multithreaded code having one of the by-ref parameter types across thread boundaries and one thread changing a value (e.g. because it was passed as "var" there and some other function works with "constref") will result in the values all threads see to be changed. </div><div dir="auto">This might be quite a constructed scenario, but we do explicitly warn in the documentation of a similar situation. See the second remark here: <a href="https://freepascal.org/docs-html/current/ref/refsu67.html#x179-20100014.4.4">https://freepascal.org/docs-html/current/ref/refsu67.html#x179-20100014.4.4</a></div><div dir="auto">(the first remark there is also somewhat important as "const" alone provides no guarantee of being passed by-ref, only that the compiler won't allow you to write assignments with the parameter or its fields on the left side). </div><div dir="auto"><br></div><div dir="auto">Regards, </div><div dir="auto">Sven </div><div class="gmail_quote" dir="auto"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
</blockquote></div></div>