lambda式メモ

lambda式

python

  • lambda 引数:処理
hello = lambda who : print(who + "hello!")
hello("inoki") # => inoki hello!

ruby

  • = -> (引数){処理} ()は省略可能
hello = -> (who){p who+" hello!"}
hello["inoki"] # => inoki hello!

パーフェクトRuby (PERFECT SERIES 6)

パーフェクトRuby (PERFECT SERIES 6)