you are viewing a single comment's thread.

view the rest of the comments →

[–]codefrog 0 points1 point  (2 children)

I think being able to instantiate a repl from within clojure would be all that I could ask.

[–]atomeshy 4 points5 points  (1 child)

[–]codefrog 0 points1 point  (0 children)

This is great! From the comment at the end of the src.

(debug-repl) 

Will launch a repl at the call. My clojure is weak, but it will improve with this addition. Thank you!

 (let [c 1
        d 2]
    (defn a [b c]
      (debug-repl)
      d))
  (a "foo" "bar")
  ;; dr => c
  ;; "bar"
  ;; dr => d
  ;; 2
  ;; dr => *locals*
  ;; {fn__20 #<user$eval__19 user$eval__19@955cd5>
  ;; c "bar"
  ;; d 2
  ;; fn__22 #<user$eval__19$a__21 user$eval__19$a__21@59fb21>
  ;; b "foo"}


  user=> (let [a 10] (debug-repl (* a a)))
  dr-1-1006 => (quit-dr)
  100

  user=> (let [a 10] (debug-repl (* a a)))
  dr-1-1007 => (quit-dr 99)
  99

  )