factory icon indicating copy to clipboard operation
factory copied to clipboard

Error with functions in function

Open TylerGrantSmith opened this issue 5 years ago • 1 comments

f<-factory::build_factory(function() { x; function() {}  }, x)
#> Error in if (fn_body == target) {: argument is of length zero
f<-factory::build_factory(function() { function(y) {x+y}  }, x)
#> Error in fn_body == target: comparison (1) is possible only for atomic and list types

Both errors occur when processing the arguments of the inner function. In the first case fn_body is NULL and in the latter it is a pairlist

TylerGrantSmith avatar Jun 03 '20 13:06 TylerGrantSmith

The first one was fixed via PR #33, woot!

I have ideas about fixing the second one... but I'm trying to decide if it's worth fixing. Did you find this via a real use case, or just poking at the edges of what's possible?

jonthegeek avatar Jun 03 '20 19:06 jonthegeek