How might I write a "defn" macro in Clojure? -
I was practicing macros writing and I can not find defn
to work .
My syntax is: (my-define name parameter body)
Ignoring & amp; Parameters and recursive routine, how do I bind a body (fn [parameter])?
(my-define body
to
(def (fn & lt) ; Args & gt; & lt; body & gt;))
This is actually quite simple:
(Defmacro my-define [name args Body] `(def ~ name (fn ~ args ~ body)))
Comments
Post a Comment