मैं defmacro जो का उपयोग करता है के लिए स्रोत को देखकर किया गया है "चलो" अपनी परिभाषा:क्लोजर में डिफैमक्रो को स्वयं के संदर्भ में कैसे परिभाषित किया जा सकता है?
(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]))
कोई व्याख्या कर सकते हैं कैसे:
(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" को उन चीज़ों के संदर्भ में कैसे परिभाषित किया जा सकता है जिन्हें पहले से परिभाषित करने के लिए "defmacro" की आवश्यकता होती है। (अगर यह समझ में आता है :)
स्पष्ट परिपत्र परिभाषा के बारे में प्रश्न नहीं है? – Jeremy