First draft of translation document

Peter Levart peter.levart at marand.si
Tue May 18 00:05:44 PDT 2010


Hello Brian,

Good work.

Just a note on section "10. Multiple lambdas per scope". While this approach is logically correct and optimizes the number of Objects created/classes used, it has a drawback that it might introduce memory leaks. A long-lived lambda might hold on to the references that it didn't actually capture in the source code.

To remedy this, the set of mutable variables S captured in the same scope by multiple lambdas where each lambda (Li; i=1..n) captures it's own subset (Si; i=1..n) would in general have to be broken into at most 2^n-1 disjunctive non-empty subsets (much less in common cases) and a separate frame object created for each of them.

Regards, Peter


On 05/17/10, Brian Goetz wrote:
> We've posted a document describing a (somewhat naive) translation strategy for 
> translation of lambda expressions by javac here:
> 
>    http://cr.openjdk.java.net/~mcimadamore/lambda_trans.pdf
> 
> 
> 


More information about the lambda-dev mailing list