Basically you define a function, and then you call save-var* on it, then you’ll save all input and output to that function. There is still work to be done, but I wanted to share this update.
You also get save-ns* which applies save-var* to every function var in the specified namespace.
Ah I see. There is definitely overlap, miracle.save has grown organically to match my needs, and since I mostly work in clr I’m not very good at looking at other libraries, since they’re generally jvm dependent. But scope-capture does seem to have little if any interop!
I do like the way you use vars to keep track of which where things was debugged from. Scales nicely. A use case where this often makes sense to me is deep within some server handles, when I want to minimize what I’m not understanding.
It’s interesting that you chose to do this function-based. Essentially capturing function input and output. That’s different from how scope capture works. I also like that you get to see a nice progression over time.
@saikyun – What do you think about auto-generating an example based (deftest ...) based on the usage you’ve captured?
Ah yeah, that’s basically what I begun with. One point of my library is to inspire that kind of debugging. Without the comments it’s 186 loc, so I feel it should be pretty easy to grasp.
Yeah, I use it when developing my games, since a function might work 190/200 invocations, and it’s pretty hard to use prn-debugging or breakpoints in that situation.
Yeah, I personally like the workflow of defing local variables in order to eval-last-sexp inside functions, and as long as your functions are pure, in/out should be enough to figure out any faulting function.
Yeah, there’s some cool stuff you can do with that. I’ve messed around a bit with creating a GUI in order to filter among saved function invocations; think excel sheet with each invocation being a row, and each parameter being a column. Then you can filter/map over each row in order to figure out a lot of data at the same time. Hard to express in words. ^^;;;
Jokes aside, I think overall there’s a lot of stuff you can do with this. It’s very easy to apply to someone else’s library as well, so I think it can be a tool to learn about how other people’s code acts as well. It would be easy to add another field that keeps track of the call stack for functions, so you could visualize the routes the data takes á la proto-repl. https://youtu.be/buPPGxOnBnk?t=1692