This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-04-01
Channels
- # announcements (14)
- # beginners (6)
- # biff (6)
- # calva (3)
- # cider (7)
- # clojure (79)
- # clojure-europe (5)
- # clojure-norway (9)
- # cursive (9)
- # data-science (20)
- # datomic (3)
- # fulcro (9)
- # graalvm (15)
- # integrant (2)
- # introduce-yourself (2)
- # jobs (1)
- # lsp (7)
- # malli (5)
- # off-topic (130)
- # parinfer (11)
- # pedestal (11)
- # portal (1)
- # practicalli (4)
- # releases (3)
- # remote-jobs (1)
- # ring (8)
- # ring-swagger (30)
- # shadow-cljs (9)
- # sql (10)
- # tools-deps (8)
If I have a let
like this:
(let [x 42
y (* 2 x);
z (/ y 10]
(frobnicate z))
What's the best way of getting the value of (* 2 x)
(or y
)? Of course if I put my cursor on the ;
and run cider-eval-last-sexp
it'll complain about x
being undefined.
So far the best I've come up with is
(let [x 42
y (* 2 x);
z (/ y 10]
y #_ (frobnicate z));
and cider-eval-last-sexp
ing from the end of the let
, but I was wondering if there was a slicker waycider-enlighten-mode (which might be somewhat unmaintained, but still work - I rarely hear about it) shines with let
and such intermediate values
https://docs.cider.mx/cider/debugging/enlighten.html
https://github.com/flow-storm/cider-storm is also a thing
Finally, a simple approach can be to (doto ,,, tap>)
and then cider-inspect the tapped value
We also have https://docs.cider.mx/cider/debugging/debugger.html So plenty to choose :)
there is also the crazy :
(let [x 42
y @(def y (* 2 x))
z (/ y 10)]
(frobnicate z))
![clojure-spin](https://emoji.slack-edge.com/T03RZGPFR/clojure-spin/aea1be92af1f8856.gif)
I also made this feature at one time, eval including parent lets: https://github.com/magnars/.emacs.d/blob/04426922530edc3ebe9bae7a86632e3b1956049d/settings/setup-clojure-mode.el#L523
There’s also https://github.com/AbhinavOmprakash/snitch 😄 (although not CIDER-related per se)