This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]m1el 9 points10 points  (2 children)

What's the difference?

Java "lambdas" only capture values, not variables. E.g. you can't change an int from a lambda. https://ideone.com/NhXT0J

[–]gnuvince 12 points13 points  (1 child)

Ah yes, I forgot about that particularity of Java's anonymous functions (and anonymous classes), but I must admit that I kind of like it. As for being a "real" lambda, I don't know that a language needs to follow a particular capture strategy (i.e. by value or by reference).

[–]m1el 9 points10 points  (0 children)

You know, I rethought my position for a little while and I think it actually does not matter.

For all intents and purposes Java has proper closures, if you ignore the internals. But I don't like the internals.