From p.dalgaard@pubhealth.ku.dk  Sun Mar  4 11:56:35 2001
From: p.dalgaard@pubhealth.ku.dk (Peter Dalgaard BSA)
Date: 04 Mar 2001 12:56:35 +0100
Subject: [Rd] Context problem with ... and rbind (PR#860)
In-Reply-To: ripley@stats.ox.ac.uk's message of "Sat, 3 Mar 2001 21:56:20 +0100 (MET)"
References: <200103032056.VAA13487@pubhealth.ku.dk>
Message-ID: <x23dctbvd8.fsf@blueberry.kubism.ku.dk>

ripley@stats.ox.ac.uk writes:

> f <- function(x, ...)
> {
>    g <- function(x, ...) x
>    rbind(numeric(), g(x, ...))
> }
> > f(1:3)
> Error in rbind(numeric(), g(x, ...)) : ... used in an incorrect context

It's not really rbind that is the culprit here, but the deparsing of
its argument. A near-minimal version of what I think is the same issue
is

f <- function(x, ...) h(g(x, ...))
g <- function(x, ...) x
h <- function(...)substitute(list(...))
f(1)
#Error in h(g(x, ...)) : ... used in an incorrect context

Also, the following is perplexing, given the definition of quote():

> quote(list(...))
list(...)
> substitute(list(...))
Error: ... used in an incorrect context

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)             FAX: (+45) 35327907
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


[Rd] Context problem with ... and rbind (PR#860)
Peter Dalgaard BSA