Re: extending R API with support for contexts
toggle quoted messageShow quoted text
I think we need to be careful here if we want to maintain implementation flexibility. IIRC, we've seen packages break due to incompatibilities between the way the AST interpreter and bytecode interpreter handle contexts. In particular, this could cause issues with function inlining etc.
Changes I'd suggest:
- Only function contexts are ever visible in the API. R_getParentContext silently skips non-function contexts.
- This should be placed in Rinterface.h, with clear comments stating that it's only intended for building interactive interfaces to R, and that code should not rely on the results having any particular values.
- R_getContextSrcRef's documentation should state that it returns the srcref 'if available' and returns R_NilValue otherwise.- Rename R_getGlobal* to R_getCurrent* or R_getActive* for clarity
- Top level context and global context aren't quite the same thing (the global context is a top level context, but not all top level contexts are the global context). Which one(s) do we need to expose in the API?
On Mon, Jan 30, 2017 at 5:15 AM, Lukas Stadler <lukas.stadler@...> wrote: