Skip to content

Commit

Permalink
Merge pull request #114 from mlr-org/crate_fix
Browse files Browse the repository at this point in the history
get corret topenv() for crate()
  • Loading branch information
mb706 authored Aug 8, 2024
2 parents 932cc3f + 2d94a16 commit 36cac4a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Config/testthat/parallel: true
Encoding: UTF-8
NeedsCompilation: yes
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.1
RoxygenNote: 7.3.2
Collate:
'Dictionary.R'
'named_list.R'
Expand Down
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# mlr3misc (development version)

* Bugfix: `crate()` is using the correct 'topenv' environment now.

# mlr3misc 0.15.1

* refactor: Update `as_callback()` functions.
Expand Down
2 changes: 1 addition & 1 deletion R/crate.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#' z = 300
#' f = meta_f(1)
#' f()
crate = function(.fn, ..., .parent = topenv(), .compile = TRUE) {
crate = function(.fn, ..., .parent = topenv(parent.frame()), .compile = TRUE) {
assert_flag(.compile)
.compile = .compile || is_compiled(.fn)
nn = map_chr(substitute(list(...)), as.character)[-1L]
Expand Down
2 changes: 1 addition & 1 deletion man/crate.Rd

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

0 comments on commit 36cac4a

Please sign in to comment.