debug
debug copied to clipboard
Debugging all callers of a function?
Sometimes I don't want to debug an expression, I want to debug all calls to a particular function. Would that belong in this package or a different library?
I'm imagining something like define/debug that works just like define but acts as if all callsites are wrapped in #R.
That would fit fine in this package. Although it won't be able to print out the expression of the callsite like #R would, and I'm not sure how a user would find which call it came from... If we do this, should define/debug define a function-like macro (sort of like rackunit does) so that it can save the source location and the expression?
I think a function-like macro like rackunit checks is a fine idea. Here's an idea for naming:
(define#R (foo arg ...) body ...)Records callsite information in the same way as wrapping callsites with#R(define#RR (foo arg ...) body ...)Callsites recorded with#RR(define#RRR (foo arg ...) body ...)Callsites recorded with#RRR
define/debug seems too long to type.