Scala Tutorialsを読む 11 Method definition 3
http://scalatutorials.com/tour/interactive_tour_of_scala_method_definition_3.html
今日は11 Method definition 3です。 Curly braces are optional on single line method bodies.
カーリーブレース {}はシングルラインメソッドの本体ならオプションです。
def add(x:Int, y:Int) = x + y
ということで、省略出来ますと言う話でした。瞬殺じゃないかぁ。 明日は12 Anonymous Functionsなのだけど、結構長いので分からない意味を調べておきましょう。
- following: 以下の
- therefore: それ故に
- omit: 除外
- Furthermore: さらに
- exactly: 正確に
- place holder: 仮に確保した場所
これで明日はちょっと楽と。