boomer icon indicating copy to clipboard operation
boomer copied to clipboard

functions rigged with rig_in_namespace don't trigger `signal_rigged_function_and_args()`

Open moodymudskipper opened this issue 3 years ago • 1 comments

When using rig_in_namespace, each function is first rigged in place, then wrappers of all those are set in each enclosing environments.

In doing so we don't provide a mask where to look for the flags for first call or evaluated args.

As a consequence, in the example below we don't signal that we enter add1_wrapper :

fake_package("fake", list(
  add1 = function(x) {
    x + 1
  },
  add1_wrapper = function(x) {
    add1(x)
  },
  rec_factorial = function(x) {
    if(x == 1) return(1)
    x * rec_factorial(x-1)
  }
))

rig_in_namespace(add1, add1_wrapper, print_args = TRUE)

add1_wrapper(1)

image

moodymudskipper avatar Jun 22 '21 11:06 moodymudskipper

Might be easier after https://github.com/moodymudskipper/boomer/issues/48

moodymudskipper avatar Jun 22 '21 11:06 moodymudskipper