Fork me on GitHub
#cider
<
2023-03-07
>
Matthew Odendahl23:03:37

I'm trying to debug something with CIDER and I'm running into a weird issue. Did I find a bug or did I miss an important concept? I created a minimal example with steps to reproduce in 🧵.

Matthew Odendahl23:03:54

alpha.clj

(ns oops.alpha)

(defn oops []
  (if (= ::check :oops.alpha/check)
    "Phew"
    "BOOM"))
beta.clj
(ns oops.beta
  (:require
   [oops.alpha :refer [oops]]))

#dbg (defn do-oops []
       (oops))

(comment
  (do-oops)

  :end)

Matthew Odendahl23:03:33

Given the above project files, these are the steps to reproduce (with commands for Spacemacs). • jack in; , ' • send oops.beta buffer; , s b • re-send do-oops to instrument; , e e on line 7 (Sending buffer seems to ignore the #dbg.) • eval (do-oops); , e e on line 10 ◦ debugger pops up, shows => "Phew" on line 6 ◦ weirdly didn't let me step in to oops. Why? • Hit i to step in anyway. ◦ shows => "Phew" on line 9. • eval (do-oops); , e e on line 10 (again) ◦ weirdly debugger didn't pop up in oops.beta ns this time. Why? ◦ pops up in oops.alpha instead. ◦ shows => false for (= ::check :oops.alpha/check) on line 4. ⁉️ ▪︎ (optional) Hit e to eval ::check. • shows => :oops.alpha/check, as expected. ▪︎ (optional) Hit e to eval (= ::check :oops.alpha/check). • shows => true. Contradiction! • Hit c to continue ◦ Now back in do-oops ◦ shows => "BOOM" on line 6 • Hit c to continue ◦ shows => "BOOM" on line 9