Inspect Clojure valuesλ︎
, d v is the Cider Inspector menu used to efficiently page through large data sets and easily navigate through nested data structures.
The Cider Inspector opens in a new buffer that shows the underlying type of the value and all of its details. of the current symbol under the cursor. This provides a very readable way to understand the value and browse through larger data sets.
The Cider Inspector is used in the REPL driven development with Spacemacs video.
Following evaluation results in Cider Inspector
The Cider Inspector will show the results of any evaluation, from
, e or
, d v menus, whilst the buffer is visible.
, d v f to evaluate a top level expression and show the results in the Cider Inspector.
p page through the data if the number of elements in the data set is greater than the page size (default 32), (
S-TAB to navigate forward and backward through the elements that can be further inspected, (
RET to inspect the current value under the cursor (
r to refresh the inspector view (
s interactively sets the page size, updating how many elements are shown in one page of the cider inspector buffer, (
q quits the cider inspector buffer
Inspecting simple valuesλ︎
Inspecting a number or character shows the underlying type, the value and properties of that type
Inspect a collection shows the underlying type, contents of that collection and index (where applicable). Only the elements are shown. The characters of the overall collection itself are not show, only the underlying type of collection (vector, map, lazy sequence, etc.).
If there are collections within collections then those values can be navigated too.
RET on an nested element in a collection will inspect that element in the same detail (
L to back to parent of a nested element (
Inspecting mutable valuesλ︎
ref, can also be inspected. The class of the container is shown, along with the class of the value it contains along with its elements.
Inspecting an atom or ref gives the value at the current time. The inspector does not update if the value of the atom or ref is updated. Use
r in the inspector buffer to refresh or restart the inspector with
, d v each time you want to check if the value has changed.
Inspecting Var meta dataλ︎
cider-inspect-last-result shows the result of the the last expression evaluated. When this is a var from a
def expression then meta information is shown as well as the class type and summary of the value.
Meta data includes the file and position of the code, the name of the var and which namespace it is defined in.
defn also shows the argument list as part of the meta data.