Need closures on your Java platform? There is no need to wait for Java 8!
This code is no longer availabe on Github. It is now availabe ( currently not with the full set of features in the original one ( interphase version instead focuses on Java 8 support ) , but it is hosted on Bitbucket ) bitbucket.org/momomo/opensource/src
Coming soon more features build on top of this such as libaries.
Hosted on GIT hub
Basically, this library gives you the ability to strictly define a .
It is a one file implementation, for usage simplicity and works as a with public and hidden
Most simple to use and understand version is but my favourite of the three is though, but have a look at as well which is a bit more dynamic, whereas and are fully static.
- A small library that currently contains only a few methods
- Uses Lib.java
- More examples in static blocks
To , , open a command prompt, standing at the root directory (where org, and examples directories are) and run:
>> java examples.v1.ClosureExamples
Is by default minimized as a compact Java 8 lambda:
Current syntax suggestion for the project lambda is pretty ugly, and hard to understand. There are too many ways a lambda/closure can be defined, it should be more coherent and consistent which will make it hard for novice developers to adopt its usage I am afraid. http://cr.openjdk.java.net/~briangoetz/lambda/lambda-state-4.html
I kind like how it looks like on this old presentation I found. http://www.slideshare.net/enbohm/project-lambda-4599885