(emit-declare key [tag & syms] grammar mopts)emits declared
(emit-declare :def '(declare a b c) +grammar+ {}) => "def a,b,c"
emits declared
(emit-declare :def
'(declare a b c)
+grammar+
{})
=> "def a,b,c"(emit-def key [tag sym body :as form] grammar mopts)creates the def string
creates the def string
(emit-form key [sym & args :as form] {:keys [reserved] :as grammar} mopts)creates a customisable emit and integrating both top-level and statements ^:hiddn
(emit-form :custom '(custom 1 2 3) (assoc-in +grammar+ [:reserved 'custom] {:emit (fn [_ _ _] 'CUSTOM)}) []) => 'CUSTOM
creates a customisable emit and integrating both top-level and statements
^:hiddn
(emit-form :custom
'(custom 1 2 3)
(assoc-in +grammar+
[:reserved 'custom]
{:emit (fn [_ _ _]
'CUSTOM)})
[])
=> 'CUSTOM(emit-top-level key [tag sym & more :as form] grammar mopts)generic define form
(binding [common/emit-fn common/emit-common] (emit-top-level :defn '(defn abc [a := 0] (+ 1 2 3)) +grammar+ {})) => "function abc(a = 0){\n 1 + 2 + 3;\n}"
generic define form
(binding [common/*emit-fn* common/emit-common]
(emit-top-level :defn
'(defn abc [a := 0]
(+ 1 2 3))
+grammar+
{}))
=> "function abc(a = 0){\n 1 + 2 + 3;\n}"(transform-defclass-inner body)transforms the body to be fn.inner and var.inner
transforms the body to be fn.inner and var.inner
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |