Skip to content

Commit 81c4965

Browse files
with() for DoPar not reflect visibility of the expression evaluated
1 parent 51573b9 commit 81c4965

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Package: doFuture
2-
Version: 1.1.3-9002
2+
Version: 1.1.3-9003
33
Title: Use Foreach to Parallelize via the Future Framework
44
Depends:
55
foreach (>= 1.5.0),

NEWS.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
## Significant Changes
44

5-
* `with(..., local = FALSE)` for `DoPar` no longer returns invisibly.
5+
* `with(..., expr, local = FALSE)` for `DoPar` now returns invisibly
6+
if `expr` does so, otherwise not.
67

78

89
# Version 1.1.3 (2025-12-08)

R/with.DoPar.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ with.DoPar <- function(data, expr, ..., local = FALSE, envir = parent.frame()) {
4141
invisible(NULL)
4242
} else {
4343
on.exit(undoDoPar())
44-
eval(expr, envir = envir, enclos = baseenv())
44+
res <- withVisible(eval(expr, envir = envir, enclos = baseenv()))
45+
if (res[["visible"]]) res[["value"]] else invisible(res[["value"]])
4546
}
4647
}

0 commit comments

Comments
 (0)