Unrestricted closures are not so constrained: they can have any return type.<br><br><div class="gmail_quote">On Fri, Nov 14, 2008 at 6:25 PM, Vladimir Kirichenko <span dir="ltr">&lt;<a href="mailto:vladimir.kirichenko@gmail.com">vladimir.kirichenko@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">This makes impossible to implement functional-style control abstractions like generators:<br>

<br>
Iterable&lt;Integer&gt; squares = yield(int i : someIterable()) { i * i }<br>
<br>
int[] sqa = &nbsp;for collect(int i : array) { i * i }<br>
<br>
It looks very inconsistent to be able to use control abstraction with &quot;void&quot; code and to be unable to use it with &quot;code with result&quot;. &nbsp;It places major limitation to usage of control abstractions. Is this really necessary?<br>

<br>
-- <br>
Best Regards,<br><font color="#888888">
Vladimir Kirichenko<br>
<br>
</font></blockquote></div><br>