Skip to content

Commit ede7bdb

Browse files
authored
Merge pull request #231 from lionel-/release-0.1.2
Release 0.1.2
2 parents 684221a + ec61b30 commit ede7bdb

File tree

21 files changed

+184
-173
lines changed

21 files changed

+184
-173
lines changed

.Rbuildignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@
88
^codecov\.yml$
99
^_pkgdown\.yml$
1010
^docs$
11+
^appveyor\.yml$

.travis.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,14 @@
33
language: r
44
sudo: false
55
cache: packages
6-
r:
7-
- oldrel
8-
- release
9-
- devel
6+
7+
matrix:
8+
include:
9+
- r: 3.1
10+
warnings_are_errors: false
11+
- r: oldrel
12+
- r: release
13+
- r: devel
1014

1115
after_success:
1216
- Rscript -e 'covr::codecov(line_exclusions = c("R/lazy.R", "R/lazy-as.R", "R/lazy-dots.R", "R/lazy-names.R", "R/lazy-call.R", "R/lazy-eval.R", "R/lazy-interp.R", "src/lazy.c"))'

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Package: rlang
2-
Version: 0.1.1
2+
Version: 0.1.2
33
Title: Functions for Base Types and Core R and 'Tidyverse' Features
44
Description: A toolbox for working with base types, core R features
55
like the condition system, and core 'Tidyverse' features like tidy

NEWS.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11

2+
# rlang 0.1.2
3+
4+
This hotfix release makes rlang compatible with the R 3.1 branch.
5+
6+
27
# rlang 0.1.1
38

49
This release includes two important fixes for tidy evaluation:

R/compat-oldrel.R

Lines changed: 19 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,39 @@
1-
# nocov start - compat-oldrel (last updated: rlang 0.1.9000)
1+
# nocov start - compat-oldrel (last updated: rlang 0.1.2)
22

33
# This file serves as a reference for compatibility functions for old
4-
# versions of R.
5-
6-
7-
# Compat function for capture functions (that will hopefully make
8-
# their way to the next R version) -----------------------------------
9-
10-
if (TRUE || utils::packageVersion("base") < "3.4.0") {
11-
12-
captureArg <- function(x, strict = TRUE) {
13-
caller_env <- parent.frame()
14-
15-
if (identical(caller_env, globalenv())) {
16-
stop("must be called in a function")
17-
}
18-
if (missing(x)) {
19-
stop("argument \"x\" is missing")
20-
}
21-
22-
.Call(rlang_capturearg, NULL, NULL, pairlist(caller_env, strict), get_env())
23-
}
24-
25-
captureDots <- function(strict = TRUE) {
26-
caller_env <- parent.frame()
27-
28-
if (!exists("...", caller_env)) {
29-
stop("must be called in a function where dots exist")
30-
}
31-
32-
.Call(rlang_capturedots, NULL, NULL, pairlist(caller_env, strict), get_env())
33-
}
34-
35-
}
4+
# versions of R. Please find the most recent version in rlang's
5+
# repository.
366

377

388
# R 3.2.0 ------------------------------------------------------------
399

40-
if (utils::packageVersion("base") < "3.2.0") {
10+
if (getRversion() < "3.2.0") {
4111

4212
dir_exists <- function(path) {
4313
!identical(path, "") && file.exists(paste0(path, .Platform$file.sep))
4414
}
4515
dir.exists <- function(paths) {
46-
map_lgl(paths, dir_exists)
16+
vapply(paths, dir_exists, logical(1))
4717
}
4818

4919
names <- function(x) {
5020
if (is.environment(x)) {
51-
ls(x, all.names = TRUE)
21+
return(ls(x, all.names = TRUE))
5222
} else {
53-
base::names(x)
23+
return(base::names(x))
5424
}
25+
26+
# So R CMD check on old versions of R sees a generic, since we
27+
# declare a names() method for dictionary objects
28+
UseMethod("names")
29+
}
30+
31+
trimws <- function(x, which = c("both", "left", "right")) {
32+
switch(match.arg(which),
33+
left = sub("^[ \t\r\n]+", "", x, perl = TRUE),
34+
right = sub("[ \t\r\n]+$", "", x, perl = TRUE),
35+
both = trimws(trimws(x, "left"), "right")
36+
)
5537
}
5638

5739
}

R/env.R

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -425,15 +425,11 @@ set_env <- function(env, new_env = caller_env()) {
425425
)
426426
}
427427

428-
mut_parent_env <- function(env, new_env) {
429-
env_ <- get_env(env)
430-
parent.env(env_) <- get_env(new_env)
431-
env
428+
mut_env_parent <- function(env, new_env) {
429+
.Call(rlang_mut_env_parent, get_env(env), new_env)
432430
}
433431
`env_parent<-` <- function(x, value) {
434-
env_ <- get_env(x)
435-
parent.env(env_) <- get_env(value)
436-
x
432+
.Call(rlang_mut_env_parent, get_env(x), value)
437433
}
438434

439435

R/eval-tidy.R

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ overscope_eval_next <- function(overscope, quo, env = base_env()) {
295295
lexical_env <- f_env(quo)
296296

297297
overscope$.env <- lexical_env
298-
mut_parent_env(overscope$.top_env, lexical_env)
298+
mut_env_parent(overscope$.top_env, lexical_env)
299299

300300
.Call(rlang_eval, f_rhs(quo), overscope)
301301
}
@@ -328,13 +328,10 @@ f_self_eval <- function(overscope, overscope_top) {
328328
return(missing_arg())
329329
}
330330

331-
# Swap enclosures temporarily by rechaining the top of the
332-
# dynamic scope to the enclosure of the new formula, if it has
333-
# one. We do it at C level to avoid GC adjustments when changing
334-
# the parent. This should be safe since we reset everything
335-
# afterwards.
336-
.Call(rlang_set_parent, overscope_top, f_env(f) %||% overscope$.env)
337-
on.exit(.Call(rlang_set_parent, overscope_top, overscope$.env))
331+
# Swap enclosures temporarily by rechaining the top of the dynamic
332+
# scope to the enclosure of the new formula, if it has one
333+
mut_env_parent(overscope_top, f_env(f) %||% overscope$.env)
334+
on.exit(mut_env_parent(overscope_top, overscope$.env))
338335

339336
.Call(rlang_eval, f_rhs(f), overscope)
340337
}

R/types.R

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -664,11 +664,6 @@ lang_type_of <- function(x) {
664664
#'
665665
#' structure(base::list, foo = "bar")
666666
#' str(base::list)
667-
#'
668-
#' # In expressions, calls and pairlists are safely copyable. However,
669-
#' # symbols are not:
670-
#' structure(quote(foo), foo = "bar")
671-
#' quote(foo)
672667
is_copyable <- function(x) {
673668
switch_type(x,
674669
NULL = ,

R/utils.R

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,25 @@ discard_unnamed <- function(x) {
7575
sxp_address <- function(x) {
7676
.Call(rlang_sxp_address, x)
7777
}
78+
79+
captureArg <- function(x, strict = TRUE) {
80+
caller_env <- parent.frame()
81+
82+
if (identical(caller_env, globalenv())) {
83+
stop("must be called in a function")
84+
}
85+
if (missing(x)) {
86+
stop("argument \"x\" is missing")
87+
}
88+
89+
.Call(rlang_capturearg, NULL, NULL, pairlist(caller_env, strict), get_env())
90+
}
91+
captureDots <- function(strict = TRUE) {
92+
caller_env <- parent.frame()
93+
94+
if (!exists("...", caller_env)) {
95+
stop("must be called in a function where dots exist")
96+
}
97+
98+
.Call(rlang_capturedots, NULL, NULL, pairlist(caller_env, strict), get_env())
99+
}

cran-comments.md

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,8 @@
1-
## Bugfix release
2-
3-
The last rlang release was sent recently, but we have discovered one
4-
issue with the bytecode compiler that causes downstream failures in
5-
the reverse dependencies of the next dplyr version. This release
6-
should prevent many R CMD check failures for compiled packages
7-
depending on dplyr.
8-
91

102
## Test environments
113

12-
* local OS X install, R 3.4.0
13-
* ubuntu 12.04 (on travis-ci), R 3.4.0
4+
* local OS X install, R 3.4.1
5+
* ubuntu 12.04 (on travis-ci), R 3.4.1
146
* win-builder (devel and release)
157

168

@@ -21,7 +13,7 @@ depending on dplyr.
2113

2214
## Reverse dependencies
2315

24-
I have run R CMD check on the 2 downstream dependencies. (Summary at
25-
https://github.com/tidyverse/rlang/tree/master/revdep).
16+
I have run R CMD check on the 37 downstream dependencies. (Summary at
17+
https://github.com/tidyverse/rlang/tree/v0.1.2/revdep).
2618

2719
There were no problems.

0 commit comments

Comments
 (0)