|
test = function(num,x,y=TRUE,error=NULL,warning=NULL,message=NULL,output=NULL,notOutput=NULL,ignore.warning=NULL) { |
Now, we set options sporadically in the text, e.g.
|
options(datatable.verbose=TRUE) |
|
options(datatable.verbose=FALSE) |
Having the option set 50, 100, or more lines away from where the value is needed harms readability. It's much better to set the options transparently in the call to test().
Proposed API:
test(..., options = list(key1 = "val1", ..., keyn = "valn"))
# impl
test <- function(..., options = NULL) {
if (!is.null(options)) {
old <- do.call("options", options)
on.exit(options(old), add = TRUE)
}
...
}
Possibly tmp_options= is a better name so as not to clash with options(), then we can do do.call(options, tmp_options).
data.table/R/test.data.table.R
Line 252 in 6c1fd83
Now, we set options sporadically in the text, e.g.
data.table/inst/tests/froll.Rraw
Line 306 in 6c1fd83
data.table/inst/tests/froll.Rraw
Line 343 in 6c1fd83
Having the option set 50, 100, or more lines away from where the value is needed harms readability. It's much better to set the options transparently in the call to
test().Proposed API:
Possibly
tmp_options=is a better name so as not to clash withoptions(), then we can dodo.call(options, tmp_options).