Skip to content
Prev 40336 / 63421 Next

External special functions (SPECIALSXP)

Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com
Or, if you'd prefer a pairlist over a call to list:
  > fp <- function(...) {
  +     dotArgList <- substitute(...())
  +     dotArgList
  + }
  > fp(message=cat("foo\n"), error=stop("Oops"),
possibleProblem=warning("Hmm"))
  $message
  cat("foo\n")

  $error
  stop("Oops")
  
  $possibleProblem
  warning("Hmm")

  > class(.Last.value)
  [1] "pairlist"
I would not have thought of this syntax myself but have
seen it in other folks' code.