(full-symbol sym fallback-ns)
Helper to expand symbol name during macro compilation. When symbol is qualified it is returned as is, otherwise fallback-ns is set as the namespace.
Example usage:
(defmacro defsomething [id options]
(let [fqsym (full-symbol id (str *ns*)))]
`(def ~id (assoc options ::id '~fqsym))))
Helper to expand symbol name during macro compilation. When symbol is qualified it is returned as is, otherwise fallback-ns is set as the namespace. Example usage: (defmacro defsomething [id options] (let [fqsym (full-symbol id (str *ns*)))] `(def ~id (assoc options ::id '~fqsym))))
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 |