2014-12-25から1日間の記事一覧

Mochi supports trailing closures from version 0.1.2

Mochi supports trailing closures from version 0.1.2. Example 1 def rmap(seq, closure): map(closure, seq) result = rmap([1, 2, 3]) -> print($1) $1 * 2 print(doall(result)) # -> 1 # -> 2 # -> 3 # => pvector([2, 4, 6]) Example 2 def foreach(s…