【发布时间】:2013-01-08 10:36:07
【问题描述】:
我正在尝试执行以下操作(只是一个示例):
(defn f [x param] (
; do something with "x" AND with "param"
))
(defn filtered-list [param] (map f ["a" "b" "c"]))
; called later as
(filtered-list 123)
; expected calls are: (f "a" 123), (f "b" 123) and (f "c" 123)
所以,我需要找到一种方法将param 传递给f,供map 使用。在 Clojure 中可以吗?此功能也可能称为"functional closure"。
【问题讨论】:
标签: clojure