-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Description
Hello !
Because most of the time I'm interested in the last spy, I found that I can inject this macro in my user NS, to avoid having to find the ep-id manually
(and because we can't do (sc.api/letsc (sc.api/last-ep-id) x) )
(defmacro letsc
[& body]
(let [ep-id (sc.api/last-ep-id)]
`(sc.api/letsc ~ep-id ~@body)))I use it like this
(defn foo [x] (sc.api/spy x))
SPY <-20> /tmp/form-init17184007261798462834.clj:1
At Code Site -20, will save scope with locals [x]
=> #'user/foo(foo 12)
SPY [91 -20] /tmp/form-init17184007261798462834.clj:1
At Execution Point 91 of Code Site -20, saved scope with locals [x]
SPY [91 -20] /tmp/form-init17184007261798462834.clj:1
x
=>
12
=> 12(letsc x)
=> 12It's really a nice improvement I think, so I would like to share it with you in case you also think so.
Thanks for scope capture, I love it :)
Metadata
Metadata
Assignees
Labels
No labels