0
以下這個問題Clojure: Expand a var in let binding和溶液https://stackoverflow.com/a/20450289/1074389通過@amalloy 如果我能動態地將值傳遞給設形式我想知道提供乏Clojure的:展開設A變種結合動態值VAR
因此,與提出的這個代碼開始通過@ammlloy ...
(defmacro with-common [& body]
`(let ~'[x 10, y 20]
[email protected]))
(with-common (+ x y))
我需要這個擴展的功能...
(defmacro with-common [x-val y-val & body]
`(let ~'[x x-val, y y-val]
[email protected]))
(with-common 2 3 (+ x y)) ;; => 5
預先感謝! 胡安