IOKE - JVM上のプロトタイプベースの新言語
JRubyの作者が作った新言語だそうです。
●Java
Arrays.asList("foo", "bar", "quux")
.map(new Function>(){
public Pair call(String str){
return new Pair(str, str.length());
}}).select ..... // これは長過ぎますよね?
●ruby
["foo", "bar", "quux"].map {|str| [str, str.length]}.select {|n| n[1] > 3}
●loke
["foo", "bar", "quux"] map(str, [str, str length]) select(second > 3)ピリオドなしで呼べるのはscalaっぽい。
デフォルトのクロージャ引数がリストのときの要素参照がfirst,secondと名づけられているのかな。
Groovyでいうと first = it[0], second = it[1]みたいな。