On Nov 22, 9:30 am, Mario Fusco <mario.fu...@gmail.com> wrote:
> The closure is the method AdderOf.add(int second) and the name "first"
> appears in its body and it is in its scope. The statements closre
> () ... of(...) are just a way to build a reference to it.

Let me be more precise.  /Closure/ is an informal word to describe a /
lambda expression/, which is an expression defining a function value
that may have /free variables/ (i.e., names that are not defined in
the function), which are /bound/ to variables defined in the /lexical
scope/.

Lambdaj simply does not do this.  "AdderOf" is an ordinary class,
"add" is an ordinary method, and "first" is an ordinary field of that
class.  There is no expression in your example that defines a function
referencing a variable from the lexically enclosing scope.

--

You received this message because you are subscribed to the Google Groups "The 
Java Posse" group.
To post to this group, send email to javapo...@googlegroups.com.
To unsubscribe from this group, send email to 
javaposse+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/javaposse?hl=.


Reply via email to