Quoth William Dunlap on Setting Orange, the 72nd of Discord: > > f <- function(...) { > + dotArgList <- substitute(list(...)) > + dotArgList > + } > > f(cat("foo\n"), stop("Oops"), warning("Hmm")) > list(cat("foo\n"), stop("Oops"), warning("Hmm")) > > # i.e., no argument was evaluated
Thanks, William! Something like this works perfectly: > debug <- function(...) { + promises <- as.list(substitute(list(...)))[-1] + str(structure(Map(eval, promises), + names=Map(deparse, promises))) + } > > a <- 2 > debug(a, a + a) List of 2 $ a : num 2 $ a + a: num 4 > For some reason, I had tried every permutation of `substitute', `list' and `...' except that one; coming to the erroneous conclusion that I couldn't avoid eval-ing `...'. I may have to screw around with the evaluation environment; but, otherwise, this is fantastic! ______________________________________________ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel