-
new_cnd()
is nowcnd()
for consistency with other constructors. Also,cnd_error()
,cnd_warning()
andcnd_message()
are nowerror_cnd()
,warning_cnd()
andmessage_cnd()
to follow our naming scheme according to which the type of output is a suffix rather than a prefix. -
Condition signallers such as
cnd_signal()
andabort()
now accept a call depth ascall
arguments. This allows plucking a call from further up the call stack (#30). -
cnd_signal()
now returns invisibly. -
cnd_signal()
andcnd_abort()
now accept character vectors to create typed conditions with several S3 subclasses. -
New
env_set()
function to set a value in an environment or a scope. If thecreate
argument isFALSE
, it only overwrites existing bindings and issues an error otherwise (#162). -
New
fn_fmls<-
andfn_fmls_names<-
setters. -
ensym()
is a new variant ofenexpr()
that expects a symbol. -
New function
chr_translate_unicode()
for turning characters serialised to unicode point form (e.g.<U+xxxx>
) to UTF-8. In addition,as_utf8_character()
now translates those as well. -
When nested quosures are evaluated with
eval_tidy()
, the.env
pronoun now correctly refers to the current quosure under evaluation (#174). Previously it would always refer to the environment of the outermost quosure. -
The new functions
cnd_warn()
andcnd_inform()
transform conditions to warnings or messages before signalling them. -
New helper
catch_cnd()
. This is a small wrapper aroundtryCatch()
that captures and returns any signalled condition. It returnsNULL
if none was signalled. -
cnd_abort()
now adds the correct S3 classes for error conditions. This fixes error catching, for instance bytestthat::expect_error()
. -
is_namespace()
is a snake case wrapper aroundisNamespace()
. -
new_fn()
takes a function and creates an object of classfn
. Thefn
print method strips attributes before printing. Thefn
class is thus convenient to augment functions with attributes with a nicer print method. -
env_get_list()
retrieves muliple bindings from an environment into a named list. -
with_bindings()
andscoped_bindings()
establish temporary bindings in an environment. -
New API for changing global options:
peek_options()
andpeek_option()
examine options;push_options()
changes options indefinitely;scoped_options()
andwith_options()
change options temporarily. -
The tidy eval
!!
operator now binds tightly. You no longer have to wrap it in parentheses, i.e.!! x > y
will only unquotex
.
-
is_node()
now returnsTRUE
for calls as well andis_pairlist()
does not returnTRUE
forNULL
objects. Useis_node_list()
to determine whether an object either of typepairlist
orNULL
. -
!!
now binds tightly in order to match intuitive parsing of tidy eval code, e.g.!! x > y
is now equivalent to(!! x) > y
. A corollary of this new syntax is that you now have to be explicit when you want to unquote the whole expression on the right of!!
. For instance you have to explicitly write!! (x > y)
to unquotex > y
rather than justx
.
eval_tidy()
no longer maps over lists but returns them literally. This behaviour is an overlook from past refactorings and was never documented.
This hotfix release makes rlang compatible with the R 3.1 branch.
This release includes two important fixes for tidy evaluation:
-
Bare formulas are now evaluated in the correct environment in tidyeval functions.
-
enquo()
now works properly within compiled functions. Before this release, constants optimised by the bytecode compiler couldn't be enquoted.
-
The
new_environment()
constructor creates a child of the empty environment and takes an optional named list of data to populate it. Compared toenv()
andchild_env()
, it is meant to create environments as data structures rather than as part of a scope hierarchy. -
The
new_language()
constructor creates calls out of a callable object (a function or an expression) and a pairlist of arguments. It is useful to avoid costly internal coercions between lists and pairlists of arguments.
-
env_child()
's first argument is now.parent
instead ofparent
. -
mut_
setters likemut_attrs()
and environment helpers likeenv_bind()
andenv_unbind()
now return their (modified) input invisibly. This follows the tidyverse convention that functions called primarily for their side effects should return their input invisibly. -
is_pairlist()
now returnsTRUE
forNULL
. We addedis_node()
to test for actual pairlist nodes. In other words,is_pairlist()
tests for the data structure whileis_node()
tests for the type.
-
env()
andenv_child()
can now get arguments whose names start with.
. Prior to this fix, these arguments were partial-matching onenv_bind()
's.env
argument. -
The internal
replace_na()
symbol was renamed to avoid a collision with an exported function in tidyverse. This solves an issue occurring in old versions of R prior to 3.3.2 (#133).
Initial release.