On Mon, Sep 12, 2011 at 12:55 PM, Ben Schulz <[email protected]> wrote:

> On 12 Sep., 21:32, clay <[email protected]> wrote:
> > A closure is when you define a function that "closes" over the local
> > environment from which the new function is defined and can access
> > local variables of that defining scope.
> Not just local variables, anything denotable from the enclosing scope,
> such as the method equals(Object), which happens to have a different
> meaning inside the "closure" than outside. This is a contradiction of
> your very definition ("a closure is a function which closes over the
> [lexically enclosing] environment") and thus disproves your
> hypothesis.
> q.e.d.
>

Technically true but practically irrelevant.

Jave has indeed had closures since day one (e.g. Runnable, Callable,
etc...). If you're not convinced, ask yourself the following question: is
there any programming construct that you will be able to do in Java 8 with
closure support that you can't do today with Runnable?

None.

The syntax will be nicer, but that's all Java 8 is adding in that area.

-- 
Cédric

-- 
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.

Reply via email to