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"><<a href="mailto:vladimir.kirichenko@gmail.com">vladimir.kirichenko@gmail.com</a>></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<Integer> squares = yield(int i : someIterable()) { i * i }<br>
<br>
int[] sqa = for collect(int i : array) { i * i }<br>
<br>
It looks very inconsistent to be able to use control abstraction with "void" code and to be unable to use it with "code with result". 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>