An nClass in a package like nimbleModel will always inherit from the nClass base class, which is in nCompiler.
As described in this R6 documentation page, it can be better to create a derived cross-package R6 class (nClasses are R6 classes) in .onLoad so that they are instantiated when the package is loaded, not when the package is built. That means they will pick up any changes from updates to the package with the base class (nCompiler in this case). If they are made when the package is built, then the package would need to be rebuilt when the base class package changes. This could easily create problems.
This issue does not propose a change right now but just keeps the issue in scope. If we move to .onLoad, I think we'd also need to make the model and declFun base classes not be predefined classes, and that would take a little tweaking so that the couple of lines code that are currently manually inserted could be automatically inserted.
An nClass in a package like nimbleModel will always inherit from the nClass base class, which is in nCompiler.
As described in this R6 documentation page, it can be better to create a derived cross-package R6 class (nClasses are R6 classes) in
.onLoadso that they are instantiated when the package is loaded, not when the package is built. That means they will pick up any changes from updates to the package with the base class (nCompiler in this case). If they are made when the package is built, then the package would need to be rebuilt when the base class package changes. This could easily create problems.This issue does not propose a change right now but just keeps the issue in scope. If we move to
.onLoad, I think we'd also need to make the model and declFun base classes not be predefined classes, and that would take a little tweaking so that the couple of lines code that are currently manually inserted could be automatically inserted.