【发布时间】:2015-10-07 13:45:45
【问题描述】:
Clojure 中是否有一个标准函数可以做到:
(defn const [x] (fn [_] x))
?
【问题讨论】:
-
@ymonad 你的评论应该是答案。
标签: clojure
Clojure 中是否有一个标准函数可以做到:
(defn const [x] (fn [_] x))
?
【问题讨论】:
标签: clojure
是的,constantly 做你想做的事:http://clojure.github.io/clojure/clojure.core-api.html#clojure.core/constantly
【讨论】: