Skip to content

Commit

Permalink
Remove the code argument from local_*
Browse files Browse the repository at this point in the history
This is unused and a remnant of the with_ implementation.

Fixes #50
  • Loading branch information
jimhester committed Aug 31, 2017
1 parent 0c4a86d commit 7beb3e0
Show file tree
Hide file tree
Showing 12 changed files with 17 additions and 17 deletions.
6 changes: 3 additions & 3 deletions R/local_.R
Expand Up @@ -11,12 +11,12 @@ local_ <- function(set, reset = set, envir = parent.frame()) {
# rename first formal to new
called_fmls[[1]] <- as.symbol("new")

fun_args <- c(alist(new =, code =), fmls[-1L])
fun_args <- c(alist(new =), fmls[-1L])
} else {
# no formals -- only have code
# no formals
called_fmls <- NULL

fun_args <- alist(code =)
fun_args <- alist()
}

set_call <- as.call(c(substitute(set), called_fmls))
Expand Down
6 changes: 3 additions & 3 deletions README.md
Expand Up @@ -23,11 +23,11 @@ There are also `with_()` and `local_()` functions to construct new `with_*` and
``` r
dir.create("test")
getwd()
#> [1] "/private/var/folders/dt/r5s12t392tb5sk181j3gs4zw0000gn/T/Rtmp4Nkju6"
#> [1] "/private/var/folders/dt/r5s12t392tb5sk181j3gs4zw0000gn/T/Rtmp5QYyoz"
with_dir("test", getwd())
#> [1] "/private/var/folders/dt/r5s12t392tb5sk181j3gs4zw0000gn/T/Rtmp4Nkju6/test"
#> [1] "/private/var/folders/dt/r5s12t392tb5sk181j3gs4zw0000gn/T/Rtmp5QYyoz/test"
getwd()
#> [1] "/private/var/folders/dt/r5s12t392tb5sk181j3gs4zw0000gn/T/Rtmp4Nkju6"
#> [1] "/private/var/folders/dt/r5s12t392tb5sk181j3gs4zw0000gn/T/Rtmp5QYyoz"
unlink("test")

Sys.getenv("HADLEY")
Expand Down
2 changes: 1 addition & 1 deletion man/with_collate.Rd

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

2 changes: 1 addition & 1 deletion man/with_dir.Rd

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

2 changes: 1 addition & 1 deletion man/with_envvar.Rd

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

2 changes: 1 addition & 1 deletion man/with_libpaths.Rd

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

2 changes: 1 addition & 1 deletion man/with_locale.Rd

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

2 changes: 1 addition & 1 deletion man/with_options.Rd

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

2 changes: 1 addition & 1 deletion man/with_par.Rd

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

2 changes: 1 addition & 1 deletion man/with_path.Rd

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

4 changes: 2 additions & 2 deletions man/with_sink.Rd

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

2 changes: 1 addition & 1 deletion man/with_temp_libpaths.Rd

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

0 comments on commit 7beb3e0

Please sign in to comment.