withr icon indicating copy to clipboard operation
withr copied to clipboard

with_debug?

Open MichaelChirico opened this issue 3 years ago • 2 comments

It could be helpful for interactive / debugging usage to have a with_debug that runs undebug on exit.

Mock usage:

withr::with_debug(lm, lm(y ~ x))

If that's in scope I'd be happy to file a PR!

MichaelChirico avatar Jun 14 '21 03:06 MichaelChirico

I guess you could also use debugonce for this

jimhester avatar Jun 14 '21 11:06 jimhester

I guess that example was bad... the use case is more like

with_debug(foo, bar())

where bar() may call foo() several times

MichaelChirico avatar Jun 14 '21 15:06 MichaelChirico