クロージャ(3)~簡略化
people.filter[ Person p| "Hans" == p.name ]
people.filter[ p | "Hans" == p.name ]
people.filter[ "Hans" == it.name ]
people.filter[ "Hans" == name ]
※ 型推論や暗黙itパラメータで簡略化
29.
クロージャ(4)~Builder DSL
html [
head [
title [$("XML encoding with Xtend")]
]
body [
h1 [$("XML encoding with Xtend")]
p [$("this dsl can be used as alternative to XML")]
※ BuilderなどのDSLとしても有効