3 ms·
Might be worth mentioning gumshoe[0] as well, which is fantastic. I use it to capture bindings without thinking about it (using the automatic plugin for develop
by sgrove 9y ago
Might be worth mentioning gumshoe[0] as well, which is fantastic. I use it to capture bindings without thinking about it (using the automatic plugin for development mode - no overhead for production!).
Often times I run a long-ish/effectful function (web request, network request, etc.) and wonder what the value was somewhere in the function, but unfortunately I didn't have the foresight to do a (def -my-value value) ahead of time.
With gumshoe, it's all automatically captured, so I can pop the values into my repl and play with them to understand what happened.
A few examples:
user> (deft add-ten [num]
(+ num 10))
#'user/add-ten
user> (add-ten 2)
12
user> -add-ten-num
2*
user> (deft destructure-example [{:keys [a b] :as args}]
a)
#'user/destructure-example
user> -destructure-example-a
1
user> -destructure-example-b
nil
user> -destructure-example-args
{:a 1, :c 2}
Anyway, it's quite surprising how often this saves my bacon. And it pairs very nicely with cider indeed!
[0] https://github.com/datodev/gumshoe#gumshoe https://github.com/datodev/gumshoe#gumshoe