rlang 0.4.1
-
New experimental framework for creating bulleted error messages. See
?cnd_messagefor the motivation and an overwiew of the tools we
have created to support this approach. In particular,abort()now
takes character vectors to assemble a bullet list. Elements named
xare prefixed with a red cross, elements namediare prefixed
with a blue info symbol, and unnamed elements are prefixed with a
bullet. -
Capture of backtrace in the context of rethrowing an error from an
exiting handler has been improved. ThetryCatch()context no
longer leaks in the high-level backtrace. -
Printing an error no longer recommends calling
last_trace(),
unless called fromlast_error(). -
env_clone()no longer recreates active bindings and is now just an
alias forenv2list(as.list(env)). Unlikeas.list()which returns
the active binding function on R < 4.0, the value of active bindings
is consistently used in all versions. -
The display of rlang errors derived from parent errors has been
improved. The simplified backtrace (as printed by
rlang::last_error()) no longer includes the parent errors. On the
other hand, the full backtrace (as printed byrlang::last_trace())
now includes the backtraces of the parent errors. -
cnd_signal()has improved support for rlang errors created with
error_cnd(). It now records a backtrace if there isn't one
already, and saves the error so it can be inspected with
rlang::last_error(). -
rlang errors are no longer formatted and saved through
conditionMessage(). This makes it easier to use a
conditionMessage()method in subclasses created withabort(),
which is useful to delay expensive generation of error messages
until display time. -
abort()can now be called without error message. This is useful
whenconditionMessage()is used to generate the message at
print-time. -
Fixed an infinite loop in
eval_tidy(). It occurred when evaluating
a quosure that inherits from the mask itself. -
env_bind()'s performance has been significantly improved by fixing a bug
that caused values to be repeatedly looked up by name. -
cnd_muffle()now checks that a restart exists before invoking
it. The restart might not exist if the condition is signalled with a
different function (such asstop(warning_cnd)). -
trace_length()returns the number of frames in a backtrace. -
Added internal utility
cnd_entrace()to add a backtrace to a
condition. -
rlang::last_error()backtraces are no longer displayed in red. -
x %|% ynow also works whenyis of same length asx(@rcannood, #806). -
Empty named lists are now deparsed more explicitly as
"<named list>". -
Fixed
chr()bug causing it to return invisibly.