Skip to content

Latest commit

 

History

History
149 lines (99 loc) · 5.23 KB

NEWS.md

File metadata and controls

149 lines (99 loc) · 5.23 KB

rlang 0.1.4.9000

  • new_cnd() is now cnd() for consistency with other constructors. Also, cnd_error(), cnd_warning() and cnd_message() are now error_cnd(), warning_cnd() and message_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() and abort() now accept a call depth as call arguments. This allows plucking a call from further up the call stack (#30).

  • cnd_signal() now returns invisibly.

  • cnd_signal() and cnd_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 the create argument is FALSE, it only overwrites existing bindings and issues an error otherwise (#162).

  • New fn_fmls<- and fn_fmls_names<- setters.

  • ensym() is a new variant of enexpr() 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() and cnd_inform() transform conditions to warnings or messages before signalling them.

  • New helper catch_cnd(). This is a small wrapper around tryCatch() that captures and returns any signalled condition. It returns NULL if none was signalled.

  • cnd_abort() now adds the correct S3 classes for error conditions. This fixes error catching, for instance by testthat::expect_error().

  • is_namespace() is a snake case wrapper around isNamespace().

  • new_fn() takes a function and creates an object of class fn. The fn print method strips attributes before printing. The fn 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() and scoped_bindings() establish temporary bindings in an environment.

  • New API for changing global options: peek_options() and peek_option() examine options; push_options() changes options indefinitely; scoped_options() and with_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 unquote x.

Breaking changes

  • is_node() now returns TRUE for calls as well and is_pairlist() does not return TRUE for NULL objects. Use is_node_list() to determine whether an object either of type pairlist or NULL.

  • !! 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 unquote x > y rather than just x.

rlang 0.1.4

  • eval_tidy() no longer maps over lists but returns them literally. This behaviour is an overlook from past refactorings and was never documented.

rlang 0.1.2

This hotfix release makes rlang compatible with the R 3.1 branch.

rlang 0.1.1

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.

New functions:

  • The new_environment() constructor creates a child of the empty environment and takes an optional named list of data to populate it. Compared to env() and child_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.

UI improvements:

  • env_child()'s first argument is now .parent instead of parent.

  • mut_ setters like mut_attrs() and environment helpers like env_bind() and env_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 returns TRUE for NULL. We added is_node() to test for actual pairlist nodes. In other words, is_pairlist() tests for the data structure while is_node() tests for the type.

Bugfixes:

  • env() and env_child() can now get arguments whose names start with .. Prior to this fix, these arguments were partial-matching on env_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).

rlang 0.1.0

Initial release.