Bring a pinned namespace up to date with its source, in place.
A pinned namespace (config :no-reload, or a protocol definer the interlock
pins) is never unloaded, so a pass leaves it behind its changed file and
every dependent that reads a var it gained fails to load. refresh!
evaluates the file's top-level forms into the LIVE namespace instead,
except the forms that would replace a type or reset state:
:type defprotocol definterface defrecord deftype gen-interface whose protocol var or class already exists: skipped, and compared with the live definition (:drift when they differ) :state a def whose live value holds state (a reference, a delay, a resource): skipped :eval everything else, the ns form included
The namespace object, its protocols, classes and stateful vars keep their identity; fns, multimethod methods, extends and new vars take the source's value.
Bring a pinned namespace up to date with its source, in place.
A pinned namespace (config :no-reload, or a protocol definer the interlock
pins) is never unloaded, so a pass leaves it behind its changed file and
every dependent that reads a var it gained fails to load. `refresh!`
evaluates the file's top-level forms into the LIVE namespace instead,
except the forms that would replace a type or reset state:
:type defprotocol definterface defrecord deftype gen-interface whose
protocol var or class already exists: skipped, and compared with
the live definition (:drift when they differ)
:state a def whose live value holds state (a reference, a delay, a
resource): skipped
:eval everything else, the ns form included
The namespace object, its protocols, classes and stateful vars keep their
identity; fns, multimethod methods, extends and new vars take the source's
value.(around! targets pass!)Refresh targets before calling pass!, then refresh again after it the
ones that failed (a form may read a var the pass itself loads).
Returns [pass-result reports], one final report per target.
Refresh `targets` before calling `pass!`, then refresh again after it the ones that failed (a form may read a var the pass itself loads). Returns [pass-result reports], one final report per target.
(form-action ns-sym form)What refresh! does with one top-level form read in ns-sym:
{:action :eval | :type | :state, :name sym-or-nil, :drift map-or-nil}.
What `refresh!` does with one top-level `form` read in `ns-sym`:
{:action :eval | :type | :state, :name sym-or-nil, :drift map-or-nil}.(refresh! ns-sym file)Evaluate file's top-level forms into the loaded namespace ns-sym,
skipping :type and :state forms (see the ns doc). Never throws. Returns
{:ns sym :file str :evaluated n :new [sym ...] :types [sym ...]
:kept [sym ...] :drift [{:name :kind :was :now} ...]
:errors [{:name :line :message} ...]}
Evaluate `file`'s top-level forms into the loaded namespace `ns-sym`,
skipping :type and :state forms (see the ns doc). Never throws. Returns
{:ns sym :file str :evaluated n :new [sym ...] :types [sym ...]
:kept [sym ...] :drift [{:name :kind :was :now} ...]
:errors [{:name :line :message} ...]}(refresh-all! targets)refresh! every [ns file] of targets, in order. Returns the reports.
`refresh!` every [ns file] of `targets`, in order. Returns the reports.
(stateful? v)Does v hold state that re-evaluating its def would replace?
Does `v` hold state that re-evaluating its def would replace?
(targets {:keys [want dragged pinned]} no-reload nses-of){ns file} for every loaded namespace of a file a pass admits (plan's
:want and :dragged) that the pass will not reload: in no-reload or one
of plan's :pinned protocol definers. nses-of maps a file to the
namespaces it defines. user is never a target.
{ns file} for every loaded namespace of a file a pass admits (`plan`'s
:want and :dragged) that the pass will not reload: in `no-reload` or one
of `plan`'s :pinned protocol definers. `nses-of` maps a file to the
namespaces it defines. `user` is never a target.Heads of the forms that define a protocol, an interface or a class.
Heads of the forms that define a protocol, an interface or a class.
(wire-report reports)Printable projection of refresh! reports.
Printable projection of `refresh!` reports.
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 |