why unrestricted closures are always void?

Vladimir Kirichenko vladimir.kirichenko at gmail.com
Fri Nov 14 17:25:10 PST 2008


This makes impossible to implement functional-style control abstractions 
like generators:

Iterable<Integer> squares = yield(int i : someIterable()) { i * i }

int[] sqa =  for collect(int i : array) { i * i }

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?

-- 
Best Regards,
Vladimir Kirichenko

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 254 bytes
Desc: OpenPGP digital signature
Url : http://mail.openjdk.java.net/pipermail/closures-dev/attachments/20081115/6b3b1abe/attachment.bin 


More information about the closures-dev mailing list