Skip to content

Commit e17d2d2

Browse files
committed
update crate env (fixes #86)
1 parent 61941d6 commit e17d2d2

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

NEWS.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# mlr3misc 0.12.0-9000
22

3+
* Updated default environment for `crate()` (#86) to `topenv()`.
34
* Added safe methods for dictionary retrieval (#83)
45
* fix: Fixed an important bug that caused serialized objects to be overly large
5-
when installing mlr3 with `--with-keep.source` (#88)
6+
when installing mlr3 with `--with-keep.source` (#88)
67

78
# mlr3misc 0.12.0
89

R/crate.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#' @param ... (any)\cr
99
#' The objects, which should be visible inside `.fn`.
1010
#' @param .parent (`environment`)\cr
11-
#' Parent environment to look up names. Default so the global environment.
11+
#' Parent environment to look up names. Default to [topenv()].
1212
#'
1313
#' @export
1414
#' @examples
@@ -24,7 +24,7 @@
2424
#' z = 300
2525
#' f = meta_f(1)
2626
#' f()
27-
crate = function(.fn, ..., .parent = .GlobalEnv) {
27+
crate = function(.fn, ..., .parent = topenv()) {
2828
nn = map_chr(substitute(list(...)), as.character)[-1L]
2929
environment(.fn) = list2env(setNames(list(...), nn), parent = .parent)
3030
.fn

0 commit comments

Comments
 (0)