indylambda: Putting invokedynamic to work for Scala
Java 8 introduced lambdas to the Java language. While the design choices differ in many regards from Scala's functions, the underlying mechanics used to represent Java lambdas is flexible enough to be used as a target for the Scala compiler.
Lambdas in Java
Java does not have canonical heirarchy of generic function types (ala
scala.FunctionN), but instead allows a lambda to be used as a shorthand for an anonymous implementation of an
Here's an example of creating a predicate that closes over one value: