<div dir="ltr">2013/11/1 Timon Gehr <span dir="ltr"><<a href="mailto:timon.gehr@gmx.ch" target="_blank">timon.gehr@gmx.ch</a>></span><br><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="im">On 11/01/2013 02:36 PM, Kenji Hara wrote:<br>
</div><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="im">
I think this is a good discovery. Currently a pure function can have<br>
lazy parameters and it is treated as a weakly pure function.<br>
<br>
pure int foo(lazy int x) { return x; }  // OK<br>
<br>
We can think the lazy parameter is a limited case of scope delegate<br>
parameter.<br></div>
...<br>
</blockquote>
<br>
They are. I think it would be quite strange to treat them differently.</blockquote><div><br></div><div>I've also felt same thing about it. The proposal will generalize the language rule. </div><div> </div><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="im">
<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">
And more, I discovered that the purity may be stronger depends on the<br>
given delegate purity.<br>
<br>
void func(scope void delegate(int) dg) pure;<br>
<br>
void main() {<br>
     int num;<br>
<br>
     // the function call has weak purity<br>
     func((x){ num = x;});<br>
<br>
     // the function call has strong purity<br>
     func((x){ ; });<br>
}<br>
<br>
Kenji Hara<br>
<br>
</blockquote>
<br></div>
Yes. Furthermore, the first delegate should have inferred type 'void delegate(int x)pure nothrow @safe' and the second delegate should have inferred type 'void delegate(int x)pure immutable nothrow @safe'.<br>

</blockquote></div><br></div><div class="gmail_extra">The first delegate should not become pure. So it would become 'void delegate(int)nothrow @safe'. I agree with the second inference result.</div><div class="gmail_extra">
<br></div><div class="gmail_extra">Kenji Hara</div></div>