/lambda-in-java

Experiments with lambda expressions in Java

Primary LanguageJava

Experiments with "lambda expressions" in Java - via inner classes.

Goal:
mimic Smalltalk / Ruby syntax of select/collect from lists:

Smalltalk
array select: [ |e| e < 10 ]

Ruby
array.select{ |e| e < 10 }

----

Class SelectableList
methods:
* select
* collect

argument: 
*anonymous inner class implementing interface
  ** Selector 
  ** Collector
Both interfaces define method evaluate(T n) - to be implemented in anonymous inner class