Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
(defn unresolvable-syms [form]
(let [usyms (atom #{})
_ (postwalk
(when (and (symbol? %) (nil? (resolve %)))
(swap! usyms conj %))
%) form)]
(defmacro exk [& args]
"[name? doc? attr-map? prepost-map? body]"
(let [{:keys [body] :as fn-decl} (args->fn-decl args)
_ (when-not (nil? (:args fn-decl))
(throw (Throwable. "exk takes no args.")))
(assoc fn-decl :args (vec (unresolvable-syms body)))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment