如何在Clojure中的宏内部的let绑定中调用函数?

时间:2019-06-10 18:03:41

标签: clojure macros

如何在带有参数的let绑定内调用函数(eval (let [fun (gensym)] `(let [~fun (fn [xs] (println xs))] (~fun [1 2 3]))))

Syntax error macroexpanding clojure.core/fn at (REPL:1:1).
(user/x) - failed: Extra input at: [:fn-tail :arity-1 :params] spec: :clojure.core.specs.alpha/param-list
user/x - failed: vector? at: [:fn-tail :arity-n :params] spec: :clojure.core.specs.alpha/param-list

我遇到了错误

{{1}}

0 个答案:

没有答案