私はその定義に「聞かせて」使用するのdefmacroのソースを見てきた:どのようにしてdefmacroを自分自身で定義できますか?
(def
^{:doc "Like defn, but the resulting function name is declared as a
macro and will be used as a macro by the compiler when it is
called."
:arglists '([name doc-string? attr-map? [params*] body]
[name doc-string? attr-map? ([params*] body)+ attr-map?])
:added "1.0"}
defmacro (fn [&form &env
name & args]
(let [prefix (loop [p (list name) args args]
しかし、マクロ自体として定義される「せ」:
(defmacro let
"binding => binding-form init-expr
Evaluates the exprs in a lexical context in which the symbols in
the binding-forms are bound to their respective init-exprs or parts
therein."
{:added "1.0", :special-form true, :forms '[(let [bindings*] exprs*)]}
[bindings & body]
(assert-args
(vector? bindings) "a vector for its binding"
(even? (count bindings)) "an even number of forms in binding vector")
`(let* ~(destructure bindings) [email protected]))
誰かがどのように説明することができます既に定義されている "defmacro"を必要とするものに関して "defmacro"をどのように定義することができるのか理解できないので、これは機能します。 (それが意味をなさない場合:)
明らかに円形の定義についての質問ではありませんか? – Jeremy