From 76bb2c8ea5449e42b315c12f9bdf0503a3fc5fde Mon Sep 17 00:00:00 2001 From: Mikko Marttila <13412395+mikmart@users.noreply.github.com> Date: Fri, 19 May 2023 20:22:10 +0100 Subject: [PATCH] Don't evaluate ... eagerly when .options are passed --- R/foreach.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/foreach.R b/R/foreach.R index dc1e0c4..4bff380 100644 --- a/R/foreach.R +++ b/R/foreach.R @@ -248,7 +248,7 @@ foreach <- function(..., .combine, .init, .final=NULL, .inorder=TRUE, # put the specified options objects into the options list for (i in opts) { bname <- substr(argnames[i], 10, 100) - options[[bname]] <- list(...)[[i]] + options[[bname]] <- eval.parent(args[[i]]) } # remove the specified options objects from args and argnames