In-house import-vars — re-export public vars from other namespaces under the
current namespace, carrying their :doc/:arglists so the facade reads like the
originals and doc/editor help work on a re-export. A tiny, dependency-free
stand-in for potemkin's import-vars (the project keeps no separate lib for it).
Value semantics are identical to a plain (def alias src): the alias captures
the source var's value at load time — it re-exports a fn/const, it does NOT
track later redefinitions, and (like a def-alias always did) it is not a
binding-rebindable handle for a dynamic source var.
In-house `import-vars` — re-export public vars from other namespaces under the current namespace, carrying their :doc/:arglists so the facade reads like the originals and `doc`/editor help work on a re-export. A tiny, dependency-free stand-in for potemkin's import-vars (the project keeps no separate lib for it). Value semantics are identical to a plain `(def alias src)`: the alias captures the source var's value at load time — it re-exports a fn/const, it does NOT track later redefinitions, and (like a def-alias always did) it is not a `binding`-rebindable handle for a dynamic source var.
(import-var alias src)Define alias in the current namespace as a re-export of src (a
fully-qualified, in-scope symbol). Copies the value and merges the source
var's :doc/:arglists onto the alias var. Returns the new var.
Define `alias` in the current namespace as a re-export of `src` (a fully-qualified, in-scope symbol). Copies the value and merges the source var's :doc/:arglists onto the alias var. Returns the new var.
(import-vars & specs)Re-export many vars in one block. Each spec is either a fully-qualified symbol
(the alias is its short name) or an explicit [alias fully/qualified] pair:
(import-vars
cancellation/cancel! ;; -> alias cancel!
[worker-runtime cancellation/worker-runtime])
Replaces a wall of hand-written (def alias ns/src) lines with one declarative
list — same value semantics, plus the source doc/arglists carried across.
Re-export many vars in one block. Each spec is either a fully-qualified symbol
(the alias is its short name) or an explicit `[alias fully/qualified]` pair:
(import-vars
cancellation/cancel! ;; -> alias `cancel!`
[worker-runtime cancellation/worker-runtime])
Replaces a wall of hand-written `(def alias ns/src)` lines with one declarative
list — same value semantics, plus the source doc/arglists carried across.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 |