Search code examples
javafunctional-programmingclosuresfunctional-java

How safe would it be to use functional-java to add closures to a Java production project?


I would love to use closures in Java. I have read that they may or may not make it into Java 7. But an open-source project called functional-java has implemented functional features including closures.

How safe would it be to use such a library in an enterprise production app?

Is there a better way to add closures to Java currently?


Solution

  • Closures will definitely not make it into Java 7, due to a lack of consensus around a single implementation. See here.

    The Functional Java library is thoroughly tested and actively developed. If you browse the source you will see that it's just simple bog-standard Java, and there's not a lot that could go wrong. I know at least one mission-critical enterprise app that uses it in production. This application has more than a million users.

    Go for it.