标签: clojure lisp smalltalk combinations
我正在尝试学习Clojure,但我的突触似乎与Smalltalk很难接触。
这个功能相当于什么?
[:n :k | (1 to: k) inject: 1 into: [:c :i | c * (n - k + i / i)]]
答案 0 :(得分:14)
等同于lst inject: s into: f的clojure为(reduce f s lst)
lst inject: s into: f
(reduce f s lst)