News for hackers. Stuff that matters.
Re:Functional Programming with Java by ndunn2 on Thursday January 06, 2011 @08:09AM (#2075109)
exactly the example I was going to cite. In Scala this would be

val b = a.exists(str=>str.forall(_.isLowerCase))

or

val b = a.exists(x=>x.toLowerCase() == x)

There's no way I'd start using functional programming in Java if it's this clunky. Just stick with Scala.

Re:Functional Programming with Java by hraberg on Thursday January 06, 2011 @09:19AM (#2075330)
Enumerable.java (http://enumerable.org) is not really a functional library, but it does support limited closures:

boolean b = a.any(λ(s, s.equals(s.toLowerCase()));

s and λ are statically imported.