search for: externalcallerenv

Displaying 1 result from an estimated 1 matches for "externalcallerenv".

2012 Aug 29
0
"Ambiguous" variation of default environment in `getClasses()` (standard function vs. formal S4 method)
...his was/is quite an interesting and unexpected behavior which I thought might be worth sharing: The default value of argument |where|in function |getClasses()|seems to vary depending on whether |getClasses()|is called inside a *standard R function*or a *formal S4 method*. It is controlled by |.externalCallerEnv()|, which seems to be "vulnerable" to /lazy evaluation/and/or an "altered" /lexical scoping/structure (possible introduced by the definition of a formals S4 method?) and thus causes the variation**. I found it quite hard to understand what's exactly going on as you need...