Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@
^codecov\.yml$
^_pkgdown\.yml$
^docs$
^appveyor\.yml$
12 changes: 8 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@
language: r
sudo: false
cache: packages
r:
- oldrel
- release
- devel

matrix:
include:
- r: 3.1
warnings_are_errors: false
- r: oldrel
- r: release
- r: devel

after_success:
- 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"))'
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: rlang
Version: 0.1.1
Version: 0.1.2
Title: Functions for Base Types and Core R and 'Tidyverse' Features
Description: A toolbox for working with base types, core R features
like the condition system, and core 'Tidyverse' features like tidy
Expand Down
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@

# 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:
Expand Down
56 changes: 19 additions & 37 deletions R/compat-oldrel.R
Original file line number Diff line number Diff line change
@@ -1,57 +1,39 @@
# nocov start - compat-oldrel (last updated: rlang 0.1.9000)
# nocov start - compat-oldrel (last updated: rlang 0.1.2)

# This file serves as a reference for compatibility functions for old
# versions of R.


# Compat function for capture functions (that will hopefully make
# their way to the next R version) -----------------------------------

if (TRUE || utils::packageVersion("base") < "3.4.0") {

captureArg <- function(x, strict = TRUE) {
caller_env <- parent.frame()

if (identical(caller_env, globalenv())) {
stop("must be called in a function")
}
if (missing(x)) {
stop("argument \"x\" is missing")
}

.Call(rlang_capturearg, NULL, NULL, pairlist(caller_env, strict), get_env())
}

captureDots <- function(strict = TRUE) {
caller_env <- parent.frame()

if (!exists("...", caller_env)) {
stop("must be called in a function where dots exist")
}

.Call(rlang_capturedots, NULL, NULL, pairlist(caller_env, strict), get_env())
}

}
# versions of R. Please find the most recent version in rlang's
# repository.


# R 3.2.0 ------------------------------------------------------------

if (utils::packageVersion("base") < "3.2.0") {
if (getRversion() < "3.2.0") {

dir_exists <- function(path) {
!identical(path, "") && file.exists(paste0(path, .Platform$file.sep))
}
dir.exists <- function(paths) {
map_lgl(paths, dir_exists)
vapply(paths, dir_exists, logical(1))
}

names <- function(x) {
if (is.environment(x)) {
ls(x, all.names = TRUE)
return(ls(x, all.names = TRUE))
} else {
base::names(x)
return(base::names(x))
}

# So R CMD check on old versions of R sees a generic, since we
# declare a names() method for dictionary objects
UseMethod("names")
}

trimws <- function(x, which = c("both", "left", "right")) {
switch(match.arg(which),
left = sub("^[ \t\r\n]+", "", x, perl = TRUE),
right = sub("[ \t\r\n]+$", "", x, perl = TRUE),
both = trimws(trimws(x, "left"), "right")
)
}

}
Expand Down
10 changes: 3 additions & 7 deletions R/env.R
Original file line number Diff line number Diff line change
Expand Up @@ -425,15 +425,11 @@ set_env <- function(env, new_env = caller_env()) {
)
}

mut_parent_env <- function(env, new_env) {
env_ <- get_env(env)
parent.env(env_) <- get_env(new_env)
env
mut_env_parent <- function(env, new_env) {
.Call(rlang_mut_env_parent, get_env(env), new_env)
}
`env_parent<-` <- function(x, value) {
env_ <- get_env(x)
parent.env(env_) <- get_env(value)
x
.Call(rlang_mut_env_parent, get_env(x), value)
}


Expand Down
13 changes: 5 additions & 8 deletions R/eval-tidy.R
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ overscope_eval_next <- function(overscope, quo, env = base_env()) {
lexical_env <- f_env(quo)

overscope$.env <- lexical_env
mut_parent_env(overscope$.top_env, lexical_env)
mut_env_parent(overscope$.top_env, lexical_env)

.Call(rlang_eval, f_rhs(quo), overscope)
}
Expand Down Expand Up @@ -328,13 +328,10 @@ f_self_eval <- function(overscope, overscope_top) {
return(missing_arg())
}

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

.Call(rlang_eval, f_rhs(f), overscope)
}
Expand Down
5 changes: 0 additions & 5 deletions R/types.R
Original file line number Diff line number Diff line change
Expand Up @@ -664,11 +664,6 @@ lang_type_of <- function(x) {
#'
#' structure(base::list, foo = "bar")
#' str(base::list)
#'
#' # In expressions, calls and pairlists are safely copyable. However,
#' # symbols are not:
#' structure(quote(foo), foo = "bar")
#' quote(foo)
is_copyable <- function(x) {
switch_type(x,
NULL = ,
Expand Down
22 changes: 22 additions & 0 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,25 @@ discard_unnamed <- function(x) {
sxp_address <- function(x) {
.Call(rlang_sxp_address, x)
}

captureArg <- function(x, strict = TRUE) {
caller_env <- parent.frame()

if (identical(caller_env, globalenv())) {
stop("must be called in a function")
}
if (missing(x)) {
stop("argument \"x\" is missing")
}

.Call(rlang_capturearg, NULL, NULL, pairlist(caller_env, strict), get_env())
}
captureDots <- function(strict = TRUE) {
caller_env <- parent.frame()

if (!exists("...", caller_env)) {
stop("must be called in a function where dots exist")
}

.Call(rlang_capturedots, NULL, NULL, pairlist(caller_env, strict), get_env())
}
16 changes: 4 additions & 12 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
## Bugfix release

The last rlang release was sent recently, but we have discovered one
issue with the bytecode compiler that causes downstream failures in
the reverse dependencies of the next dplyr version. This release
should prevent many R CMD check failures for compiled packages
depending on dplyr.


## Test environments

* local OS X install, R 3.4.0
* ubuntu 12.04 (on travis-ci), R 3.4.0
* local OS X install, R 3.4.1
* ubuntu 12.04 (on travis-ci), R 3.4.1
* win-builder (devel and release)


Expand All @@ -21,7 +13,7 @@ depending on dplyr.

## Reverse dependencies

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

There were no problems.
5 changes: 0 additions & 5 deletions man/is_copyable.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

92 changes: 54 additions & 38 deletions revdep/README.md
Original file line number Diff line number Diff line change
@@ -1,53 +1,69 @@
# Setup
# Platform

## Platform

|setting |value |
|field |value |
|:--------|:----------------------------|
|version |R version 3.4.0 (2017-04-21) |
|version |R version 3.4.1 (2017-06-30) |
|os |macOS Sierra 10.12 |
|system |x86_64, darwin15.6.0 |
|ui |X11 |
|language |(EN) |
|collate |en_US.UTF-8 |
|tz |Europe/Brussels |
|date |2017-05-17 |

## Packages

|package |* |version |date |source |
|:---------|:--|:-------|:----------|:--------------|
|covr | |2.2.2 |2017-01-05 |cran (@2.2.2) |
|knitr | |1.15.1 |2016-11-22 |cran (@1.15.1) |
|rlang | |0.1 |2017-05-06 |cran (@0.1) |
|rmarkdown | |1.5 |2017-04-26 |cran (@1.5) |
|testthat | |1.0.2 |2016-04-23 |cran (@1.0.2) |

# Check results
|date |2017-08-08 |

2 packages
# Dependencies

|package |version | errors| warnings| notes|
|:-------|:-------|------:|--------:|-----:|
|sf |0.4-3 | 0| 0| 1|
|tibble |1.3.1 | 0| 0| 0|
|package |old |new |Δ |
|:-------|:-----|:-----|:--|
|rlang |0.1.1 |0.1.2 |* |

## sf (0.4-3)
Maintainer: Edzer Pebesma <edzer.pebesma@uni-muenster.de>
Bug reports: https://github.com/edzer/sfr/issues/
# Revdeps

0 errors | 0 warnings | 1 note
## Broken (1)

```
checking installed package size ... NOTE
installed size is 7.9Mb
sub-directories of 1Mb or more:
doc 4.0Mb
sqlite 1.5Mb
```
|package |version |error |warning |note |
|:------------------------|:-------|:------|:-------|:----|
|[banR](problems.md#banR) |0.2.0 |__+1__ | |1 |

## tibble (1.3.1)
Maintainer: Kirill Müller <krlmlr+r@mailbox.org>
Bug reports: https://github.com/tidyverse/tibble/issues
## All (37)

0 errors | 0 warnings | 0 notes
|package |version |error |warning |note |
|:------------------------|:-------|:------|:-------|:----|
|[banR](problems.md#banR) |0.2.0 |__+1__ | |1 |
|dbplyr |1.1.0 | | |1 |
|dexter |0.4.2 | |2 |1 |
|dplyr |0.7.2 | | |2 |
|fold |0.2.1 | | | |
|ggformula |0.5 | | |1 |
|iadf |0.1.0 | | | |
|implyr |0.2.1 |1 | | |
|later |0.3 | | | |
|metaplot |0.1.5 | | | |
|mosaicCore |0.2.0 | | | |
|nofrills |0.1.0 | | | |
|nonmemica |0.7.6 | |1 |1 |
|NPMOD |0.1.0 |1 | | |
|polypoly |0.0.2 | | | |
|prisonbrief |0.1.0 | | |1 |
|purrr |0.2.3 | | | |
|recipes |0.1.0 | | | |
|rsample |0.0.1 | | | |
|RSDA |2.0.2 | | | |
|seplyr |0.1.3 | | |1 |
|sf |0.5-3 |1 | | |
|sjmisc |2.6.0 | | | |
|sjPlot |2.3.2 | | |2 |
|sjstats |0.10.3 | | |1 |
|sparklyr |0.6.1 |1 | | |
|spdplyr |0.1.3 | | | |
|statar |0.6.5 | | | |
|stplanr |0.1.9 | |1 | |
|sugrrants |0.1.0 | | | |
|tatoo |1.0.7 | | | |
|taxa |0.1.0 | | |1 |
|tibble |1.3.3 | | | |
|tidygraph |1.0.0 | | | |
|tidyselect |0.1.1 | | |1 |
|valr |0.3.1 | | | |
|vdiffr |0.2.0 | | | |

Binary file added revdep/data.sqlite
Binary file not shown.
Loading