File: cider-ns.el.html

Smart code refresh functionality based on ideas from: http://thinkrelevance.com/blog/2013/06/04/clojure-workflow-reloaded

Note that refresh with clojure.tools.namespace.repl is a smarter way to reload code: the traditional way to reload Clojure code without restarting the JVM is (require ... :reload) or an editor/IDE feature that does the same thing.

This has several problems:

If you modify two namespaces which depend on each other, you must remember to reload them in the correct order to avoid compilation errors.

If you remove definitions from a source file and then reload it, those definitions are still available in memory. If other code depends on those definitions, it will continue to work but will break the next time you restart the JVM.

If the reloaded namespace contains defmulti, you must also reload all of the associated defmethod expressions.

If the reloaded namespace contains defprotocol, you must also reload any records or types implementing that protocol and replace any existing instances of those records/types with new instances.

If the reloaded namespace contains macros, you must also reload any namespaces which use those macros.

If the running program contains functions which close over values in the reloaded namespace, those closed-over values are not updated (This is common in web applications which construct the "handler stack" as a composition of functions.)

Defined variables (6)

cider-ns-code-reload-toolWhich tool to use for ns refresh.
cider-ns-refresh-after-fnClojure function for ‘cider-ns-refresh’ to call after reloading.
cider-ns-refresh-before-fnClojure function for ‘cider-ns-refresh’ to call before reloading.
cider-ns-refresh-show-log-bufferControls when to display the refresh log buffer.
cider-ns-save-files-on-refreshControls whether to prompt to save files before refreshing.
cider-ns-save-files-on-refresh-modesControls which files might be saved before refreshing.

Defined functions (7)

cider-ns--present-error(ERROR)
cider-ns--reload-op(OP-NAME)
cider-ns-refresh(&optional MODE)
cider-ns-refresh--handle-response(RESPONSE LOG-BUFFER)
cider-ns-refresh--save-modified-buffers(&optional CONNECTION)
cider-ns-reload(&optional PROMPT)
cider-ns-reload-all(&optional PROMPT)

Defined faces (0)