A namespace at a glance, from the running system's own metadata: every
var with its signature, source order preserved, privates included and
marked — the gist of a namespace, not just its API (§7). Runtime over
parsing, deliberately: everything the glance needs — arglists, doc,
the macro and private flags, line — already sits on the vars, for any
loaded namespace with no file plumbing, and reflects what is live after
a hot reload rather than what is on disk. Source-level outlining
(unloaded files, comment blocks, the shape of a file as written) is
form/changed-forms territory and stays there.
A namespace at a glance, from the running system's own metadata: every var with its signature, source order preserved, privates included and marked — the gist of a namespace, not just its API (§7). Runtime over parsing, deliberately: everything the glance needs — arglists, doc, the macro and private flags, line — already sits on the vars, for any loaded namespace with no file plumbing, and reflects what is live after a hot reload rather than what is on disk. Source-level outlining (unloaded files, comment blocks, the shape of a file as written) is `form`/`changed-forms` territory and stays there.
(file x)The source file of the namespace x designates, verbatim, as a string.
The munged namespace path is tried first (.clj, then .cljc), so a
namespace assembled from several files — clojure.core loads five —
answers with its defining file; the :file metadata its vars carry is
the fallback, covering unconventional layouts. Throws a plain
explanation when no file is on the classpath — REPL-minted namespaces
and source-stripped AOT jars have none, and that is worth saying
outright rather than returning nil.
The source file of the namespace `x` designates, verbatim, as a string. The munged namespace path is tried first (`.clj`, then `.cljc`), so a namespace assembled from several files — clojure.core `load`s five — answers with its defining file; the `:file` metadata its vars carry is the fallback, covering unconventional layouts. Throws a plain explanation when no file is on the classpath — REPL-minted namespaces and source-stripped AOT jars have none, and that is worth saying outright rather than returning nil.
(nses)(nses match)Every loaded namespace, sorted — the system at a glance, and the top of
the drilldown that outline continues. match (string or regex, the
same matcher outline takes; a symbol is matched as its name, so
(nses 'some.ns) answers whether a namespace is really loaded) keeps
only matching names. Names only, deliberately: a flat vector of
symbols is the composable form — filter it, count it, map outline
over it. Loaded namespaces, not the classpath: what the running system
has actually required.
Every loaded namespace, sorted — the system at a glance, and the top of the drilldown that `outline` continues. `match` (string or regex, the same matcher `outline` takes; a symbol is matched as its name, so `(nses 'some.ns)` answers whether a namespace is really loaded) keeps only matching names. Names only, deliberately: a flat vector of symbols is the composable form — filter it, count it, map `outline` over it. Loaded namespaces, not the classpath: what the running system has actually required.
(outline ns)(outline ns {:keys [include-docstrings match]})The outline of the namespace ns designates: {:ns sym :doc gist :vars [entry …]}, entries in source order, privates included and
marked — the glance, signatures only, safe for any size of namespace.
Options: :include-docstrings carries every docstring whole (and the
full ns docstring); :match (string or regex) keeps only vars whose
name or docstring matches. The default flipped twice on 2026-08-05:
docstrings-on when this call was the initialize instructions'
bootstrap and both fresh tenants stripped the option; back to the
glance when the rendered manual moved into the instructions
themselves and outline returned to being a reading tool.
The outline of the namespace `ns` designates: `{:ns sym :doc gist
:vars [entry …]}`, entries in source order, privates included and
marked — the glance, signatures only, safe for any size of namespace.
Options: `:include-docstrings` carries every docstring whole (and the
full ns docstring); `:match` (string or regex) keeps only vars whose
name or docstring matches. The default flipped twice on 2026-08-05:
docstrings-on when this call was the initialize instructions'
bootstrap and both fresh tenants stripped the option; back to the
glance when the rendered manual moved into the instructions
themselves and outline returned to being a reading tool.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 |