Hacker News new | ask | show | jobs
by spullara 5397 days ago
The single abstract method interface type of a lambda will be inferred by its declaration site.
1 comments

Will they be full closures and remember the state of objects in scope?
If they will be based on anonymous inner classes, then yes, they'll capture the variables from the surrounding scope. Those variables however will be 'final', which means that you can't re-assign them, even if their values are still liable to side-effects (e.g. setting fields, mutating collections, etc).
They are not based on anonymous inner classes (the implementation is likely to be much different) but they have the same restrictions as BDFFL_Xenu described.