Ensure that arglists are quoted in the resulting code

This commit is contained in:
Joshua Suskalo 2021-09-16 14:09:54 -05:00
parent db9f3b5209
commit 268e1cb598

View file

@ -455,7 +455,6 @@
(s/cat :arglist (s/coll-of simple-symbol? :kind vector?) (s/cat :arglist (s/coll-of simple-symbol? :kind vector?)
:body (s/* any?))))) :body (s/* any?)))))
;; TODO(Joshua): Finish this
(defmacro defcfn (defmacro defcfn
{:arglists '([name docstring? symbol arg-types ret-type arglist & body])} {:arglists '([name docstring? symbol arg-types ret-type arglist & body])}
[& args] [& args]
@ -480,11 +479,13 @@
~(vary-meta (:name args) ~(vary-meta (:name args)
update :arglists update :arglists
(fn [old-list] (fn [old-list]
(list
'quote
(or old-list (or old-list
(list (list
(or (-> args :fn-tail :arglist) (or (-> args :fn-tail :arglist)
(mapv (comp symbol name) (mapv (comp symbol name)
(:native-arglist args))))))) (:native-arglist args))))))))
~@(list (:doc args)) ~@(list (:doc args))
fun#)))) fun#))))