<div dir="ltr"><div style>I also think writing DIP would be better.</div><div style><br></div><div style>I can tell some reasonable points about 'scope ref'.</div><div style>- 'in ref' has been allowed from 2.060 (<a href="http://d.puremagic.com/issues/show_bug.cgi?id=8105">http://d.puremagic.com/issues/show_bug.cgi?id=8105</a>)</div>
<div style>- 'scope ref' is still disallowed. ("Error: scope cannot be ref or out")</div><div style>- 'scope' means "the reference cannot escape from local scope".</div><div style>  And an rvalue reference cannot escape from passed function. There is consistent semantics.</div>
<div style>- 'in' is equivalent to 'const scope' ( <a href="http://dlang.org/function.html">http://dlang.org/function.html )</a></div><div style>  So, 'in ref' is equivalent to 'const scope ref'.</div>
<div style>- Currently 'scope' affects to delegate parameter. In other cases, 'scope' has no meaning.</div><div style><br></div><div style>I recognize that Jonathan had opposed to 'in ref' because it had supported just only "const rvalue reference" (like 'cosnt T&' in C++). In D, 'const' means physical const, so he has thought that mutable rvalue reference should be supported in D.</div>
<div style><br></div><div style>So, I think 'scope ref' is good proposal against the Jonathan's objection.</div><div style><br></div><div style><br></div><div style>Kenji Hara</div><div style><a href="http://dlang.org/function.html"><font color="#222222"><br>
</font></a>2013/4/5 Dicebot <span dir="ltr"><<a href="mailto:m.strashun@gmail.com" target="_blank">m.strashun@gmail.com</a>></span></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div class=""><div class="h5">On Thursday, 4 April 2013 at 14:43:26 UTC, Namespace wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
On Thursday, 4 April 2013 at 07:52:51 UTC, Dicebot wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
After some thinking on topic I come to conclusion that rvalue refs _should_ be "scope ref" and stuff like "ref int f(@temp ref int x) { return x; }" is invalid. I can see no valid use case for such an error-prone case. Contrary, "scope ref" feels just like it was designed for this task, also a good moment to actually define what "scope" means.<br>

</blockquote>
<br>
I am beginning to like scope ref also. It just fits.<br>
Nice that we agree on that now - but I still miss Kenji's, Walters and Andrei's blessing. Otherwise I think it would be ripe for a pull request. Or there is any difficulty?<br>
</blockquote>
<br></div></div>
I don't know. My opinion has no value here. I may advice to write a DIP that makes more accent on theoretical side of problem - what "scope" currently is, how it combines with ref now, how it should combine, how Andrei's DIP fits in the picture, how it fits overall type system, what are possible code breakage scenarios, what are typical use cases for this feature etc. If such DIP and matching pull request do exist, it is only matter of agreement (with Andrei/Walter) about points stated in DIP.<br>

</blockquote></div><br></div></div>