I've always been intrigued by these blocks we have in java, what does javac
actually generate for them? I'd always hoped that the closures proposals
might just start small and make these blocks a first class citizen.
From:
public void test() {
int foo = 1;
{
int bar = foo + 2;
}
//MARK
}
to:
public void test() {
int foo = 1;
Method foobar = {
int bar = foo + 2;
}
foobar.invoke(null);
//MARK
}
*sigh* I want my closures and mixins.
--
Pull me down under...
Sent from Auckland, Auk, New Zealand
On Wed, Sep 2, 2009 at 5:47 AM, Reinier Zwitserloot <[email protected]>wrote:
> You can put { (statements) } anywhere in java code where a statement
> is legal. Like any other occurrence of {} to delimit code, any
> variable declarations inside the {} are not visible outside the
> brackets. So, this:
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "The
Java Posse" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/javaposse?hl=en
-~----------~----~----~----~------~----~------~--~---