State of the Lambda

John Rose john.r.rose at
Thu Jul 8 20:15:16 PDT 2010

On Jul 8, 2010, at 12:02 PM, Brian Goetz wrote:

> Another is to do something really CICE-like:
>       executor.submit(new Callable<String>(args) { -> "foo"} );

Cute:  Starts like an anonymous inner class (so it shouts "I'm a class!") but ends with a closure body (which murmurs, "here's your code, sir").

But, just because something can be compressed doesn't mean it should be.  A pattern needs to be common in order for its compression to pay off.  Are there numbers that show that inner classes with constructor arguments are common enough to make this extension of CICE worth the effort?  I suspect not.

-- John

P.S. I'll throw out a general question that is related:  How common is access to 'protected' names from inner classes that implement SAM types?  This is one of the peculiar strengths of CICE, but I'm curious how often it would be used.  I suspect it would be infrequently used.

More information about the lambda-dev mailing list