Skip to content
Prev 61519 / 63424 Next

removeSource() vs. function literals

If you can afford a dependency on rlang, `rlang::zap_srcref()` deals
with this. It's recursive over expression vectors, calls (including
calls to `function` and their hidden srcref arg), and function
objects. It's implemented in C for efficiency as we found it to be a
bottleneck in some applications (IIRC caching). I'd be happy to
upstream this in base if R core is interested.

Best,
Lionel
On 3/30/23, Duncan Murdoch <murdoch.duncan at gmail.com> wrote: