optenv <- define_option("test")
print(optenv)
# Error: argument is missing, with no default
I think the problem is with line values <- as.list(x) in format.options_env(). The call as.list() forces the evaluation of promises, which fails if the promise is an empty symbol (bquote()) or references any non-existing symbol in the environment. Instead of as.list(), the function should loop through the individual elements and render the unevaluated expression (see ?delayedAssign for the eval(substitute(substitute(...))) idiom, or simply take the specs defaults) and its evaluated value only if available. Otherwise, render <unset> or the error message, but do not fail.
Certainly a bug. At the very minimum, the error message is unhelpful, but I think overall the behavior can certainly be improved. Thanks for reporting this.
I think the problem is with line
values <- as.list(x)
informat.options_env()
. The callas.list()
forces the evaluation of promises, which fails if the promise is an empty symbol (bquote()
) or references any non-existing symbol in the environment. Instead ofas.list()
, the function should loop through the individual elements and render the unevaluated expression (see?delayedAssign
for theeval(substitute(substitute(...)))
idiom, or simply take the specs defaults) and its evaluated value only if available. Otherwise, render<unset>
or the error message, but do not fail.