Closed paciorek closed 2 days ago
Followup: given nCompiler
, I think I will propose:
nCompiler
lookup and handle things more robustly there.See related issue #1469, including the possibility of using getAnywhere
rather than get
.
@paciorek I agree with both instincts: leave as is because we'll have a revamped system coming into place; and if using getAnywhere
and checking what results are actually nimbleFunctions is not too hard to do, I'm not opposed to it. There may be multiple places where this would need to be done. All of that said, I would vote for leaving as is for now.
I'm error-trapping this via #1517 .
If a user defines a nimbleFunction whose name is the same as the name of a function in the nimble DSL, in compiled code we use the DSL function and not the user's nimbleFunction. E.g.,
exp
,log1p
,gamma
, etc.This is a problem for (at least) two reasons:
Some options:
exprClasses_setSizes
to look for RC functions first.genCpp_sizeProcessing.R
, the lookup (via R's scoping) when usingget(code$name)
will find names inbase::
before names in GlobalEnv, which will cause problems with defaulting to using user-defined RC functions.gamma()
is a more complicated variation on this given we translategamma
->gammafn
earlier on...@perrydv this is not urgent, but we'll want to discuss for 1.3.0.