This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-08-25
Channels
- # admin-announcements (18)
- # beginners (16)
- # boot (13)
- # bristol-clojurians (1)
- # cider (41)
- # clojure (116)
- # clojure-berlin (1)
- # clojure-italy (2)
- # clojure-japan (6)
- # clojure-russia (94)
- # clojurescript (46)
- # clojutre (5)
- # core-matrix (2)
- # cursive (1)
- # datascript (14)
- # datomic (10)
- # devops (73)
- # editors (3)
- # emacs (19)
- # hoplon (382)
- # jobs (1)
- # ldnclj (8)
- # ldnproclodo (4)
- # off-topic (50)
- # onyx (3)
- # reagent (2)
- # yada (19)
@alejandro: can you share with us some concrete use-case regarding what you want to do?
we don’t have real conditional breaks (although you can definitely request their addition)
@alejandro: You can add an if
into your code, and then break inside a branch of that if
YOu can also try binding the *skip-breaks*
var to (atom true)
, this is leveraging on internal debugger stuff, but it might work
(defn do-it [arg]
(binding [cider.nrepl.middleware.debug/*skip-breaks*
(if (i-want-to-break arg)
cider.nrepl.middleware.debug/*skip-breaks*)
(atom true)]
(do-the-usual-function-here)))
@bozhidar: really just want to use it for a clause in a loop (or function called in a loop), but only on like the 10,000th iteration
@malabarba: I actually haven’t been able to get #break or #dbg to work at all. I use the "cider instrument top level form” to get it to work
@alejandro: Oh, then you're probably using 0.9.1. The #break and #dbg are only on the snapshot release for now.
@malabarba: got it. what’s the best way to move to the snapshot release? I have no problem using a later build
@alejandro: The *skip-breaks*
solution might still work
@malabarba: hmm, says I’m on cider snapshot already 0.10.0snapshot (20150824.244)
hmm, maybe I was using it incorrectly? I tried it in a lengthy let
statement and it wasn’t triggering yesterday
cool, I’ll roll with that. That will make a conditional break much easier to set up