cider 2025-07-04

A couple of new fun inspector features in the rolling CIDER cider: • Sorting maps by keys. You can now press S inside the inspector window to sort the currently inspected map by its keys. You can also customize cider-inspector-sort-maps to make this behavior enabled by default. Either way, you can always toggle it on and off with S. • Inspector diff mode. Inspired by tools like https://github.com/lambdaisland/deep-diff2, CIDER inspector now has its own diff renderer. To activate it, you need to write an expression like this in your code buffer: (orchard.inspect/diff data1 data2), and then inspect this expression with C-c M-i. You will get the inspector view like the one in the screenshot below. The inspector will display the "merged" nested data structure where common parts are displayed as is, and the distinctive parts have pseudo-reader-tag markers. #≠ tag next to a map or a vector means that this data structure has one or more diffs inside it. tag signifies that two values are completely different at that spot. You can press D in the inspector window to only display the differing parts in two data structures (see screenshot #3). Naturally, the diff view can be navigable just like a regular data structure. Here's a code example you can use to try out the diff inspector, kindly borrowed from deep-diff2:

(orchard.inspect/diff
 [{:tea/type "Jinxuan Oolong"
   :tea/color "Green"
   :tea/region "Alishan"
   :aliases ["Milky Wulong" "Jinxuan"]
   :temperature 80}
  {:tea/type "Dong Ding"
   :tea/region "Nantou"
   :aliases ["Frozen summit" "Dongti" "Dong ding wulong"]}
  "same string"
  3]
 [{:tea/type "Jinxuan Wulong"
   :tea/color "Green"
   :tea/region "Alishan"
   :aliases ["Milky Wulong" "金宣" "Jinxuan"]
   :temperature 75}
  {:tea/type "Dong Ding"
   :tea/region "Nantou"
   :aliases ["Frozen summit" "Dongti" "Dong ding wulong"]
   :temperature 85}
  "same string"
  4])

🆒 7
❤️ 1
😋 5