-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
So it looks like we need to revise how user-defined opDefs are found.
Currently, registerOpDef puts them in nCompiler:::operatorDefUserEnv.
However, if an opDef is registered at build time as part of a user package, those changes to nCompiler:::operatorDefUserEnv will of course not be available at run time when the user package is being used.
Here's a proposal for what I think we need to do:
- when
registerOpDefis called, if it's done in the context of a package namespace (presumably based on a new argument,where = parent.frame()), createuserPkg:::operatorDefUserEnv(if needed) and put the opDefs there. - then when we go to look for an opDef, we should use
nGetto look foroperatorDefUserEnv, finding it in theuserPkgnamespace if present and then in thenCompilernamespace, based on it being animportsofuserPkg.
I suppose we could tell package developers to register opDefs via onLoad() but that doesn't feel right.
@perrydv what do you think? Does that plan sound reasonable? Other ideas? I can implement once we decide on a path forward.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels