nCompiler
nCompiler copied to clipboard
wrap messaging in verbosity control
Just a general flag that nCompiler should systematically handle verbosity control both in compiled and uncompiled execution.
One motivation is that CRAN checks new packages to see if print/cat calls are wrapped with verbosity control. We got this request when we submitted nimbleQuad:
You write information messages to the console that cannot be easily
suppressed.
It is more R like to generate objects that can be used to extract the
information a user is interested in, and then print() that object.
Instead of print() rather use message()/warning() or if(verbose)cat(..)
(or maybe stop()) if you really have to write text to the console.
(except for print, summary, interactive functions)
For more details:
<https://contributor.r-project.org/cran-cookbook/code_issues.html#using-printcat>
In the case they flagged the calls were in nf code, but the general principle still stands and in any event, we do not want to get into an argument with them about what is compiled/uncompiled.