Closed jefffriesen closed 6 years ago
@jefffriesen This use case seems too specific for scope-capture - it's more of a job for a tracing library or a custom macro.
Note that, if each step is a pure and deterministic computation (as it should be most of the time, since Clojure encourages functional programming!), you can get the desired result by reproducing the context of the expression + some paredit-fu to re-evaluate a growing number of steps (e.g: move the closing paren of the (->> ...)
expression to right after keyword-map
, evaluate, then slurp in the next expression, evaluate, and so on.)
You could also imagine creating your own spy->>
macro that logs and/or records and/or spies each intermediate step!
Ok, thanks @vvvvalvalval
It would be nice to be able to capture each step in threading macros. For example:
I could capture the intermediate state for each step in this thread last macro. When I tried this spy only captured the function arguments. I couldn't see a way to capture the rest in the documentation. Do you think this would be a good feature?