[Rd] Status of reserved keywords and builtins

2013-12-12 Thread Karl Millar
According to http://cran.r-project.org/doc/manuals/r-release/R-lang.html#Reserved-words if else repeat while function for in next break TRUE FALSE NULL Inf NaN NA NA_integer_ NA_real_ NA_complex_ NA_character_ ... ..1 ..2 etc. are all reserved keywords. However, in R 3.0.2 you can do t

Re: [Rd] Status of reserved keywords and builtins

2013-12-12 Thread Duncan Murdoch
On 12/12/2013 2:08 PM, Karl Millar wrote: According to http://cran.r-project.org/doc/manuals/r-release/R-lang.html#Reserved-words if else repeat while function for in next break TRUE FALSE NULL Inf NaN NA NA_integer_ NA_real_ NA_complex_ NA_character_ ... ..1 ..2 etc. are all reser

[Rd] internal manipulation of ...

2013-12-12 Thread Romain François
Hello, I’m looking for examples on how to manipulate the ... internally, e.g. in a .Call or .External function. I’m particularly interested in accessing the environment in which each contribution to ... can be evaluated. So far, I’m using tricks involving passing down the sys.calls() and s

Re: [Rd] internal manipulation of ...

2013-12-12 Thread Simon Urbanek
On Dec 12, 2013, at 3:32 PM, Romain François wrote: > Hello, > > I’m looking for examples on how to manipulate the ... internally, e.g. in a > .Call or .External function. > > I’m particularly interested in accessing the environment in which each > contribution to ... can be evaluated. >

Re: [Rd] internal manipulation of ...

2013-12-12 Thread Romain François
Le 13 déc. 2013 à 00:15, Simon Urbanek a écrit : > > On Dec 12, 2013, at 3:32 PM, Romain François wrote: > >> Hello, >> >> I’m looking for examples on how to manipulate the ... internally, e.g. in a >> .Call or .External function. >> >> I’m particularly interested in accessing the enviro

Re: [Rd] internal manipulation of ...

2013-12-12 Thread Hadley Wickham
Could you pass the environment and then look for the object called ... in it? f <- function(...) { .Call("my_fun", environment()) } I think (and may well be wrong) that you can use standard tools to find the DOTSXP object in that environment. Hadley On Thu, Dec 12, 2013 at 2:32 PM, Romain Fr

Re: [Rd] Status of reserved keywords and builtins

2013-12-12 Thread Duncan Murdoch
On 13-12-12 3:22 PM, Duncan Murdoch wrote: On 12/12/2013 2:08 PM, Karl Millar wrote: According to http://cran.r-project.org/doc/manuals/r-release/R-lang.html#Reserved-words if else repeat while function for in next break TRUE FALSE NULL Inf NaN NA NA_integer_ NA_real_ NA_complex_ N

[Rd] Proper way to drop 'srcref' from an expression created via substitute(function() ...)?

2013-12-12 Thread Henrik Bengtsson
First, why does this expression have a 'srcref' element: > exprA <- substitute(function(x) a*x, list(a=2)) > print(exprA) function(x) 2 * x > str(as.list(exprA)) List of 4 $ : symbol function $ :Dotted pair list of 1 ..$ x: symbol $ : language 2 * x $ :Class 'srcref' atomic [1:8] 1 20 1 34

Re: [Rd] Proper way to drop 'srcref' from an expression created via substitute(function() ...)?

2013-12-12 Thread Duncan Murdoch
On 13-12-12 7:57 PM, Henrik Bengtsson wrote: First, why does this expression have a 'srcref' element: exprA <- substitute(function(x) a*x, list(a=2)) print(exprA) function(x) 2 * x str(as.list(exprA)) List of 4 $ : symbol function $ :Dotted pair list of 1 ..$ x: symbol $ : language

Re: [Rd] Proper way to drop 'srcref' from an expression created via substitute(function() ...)?

2013-12-12 Thread Henrik Bengtsson
Thanks. /Henrik On Thu, Dec 12, 2013 at 5:27 PM, Duncan Murdoch wrote: > On 13-12-12 7:57 PM, Henrik Bengtsson wrote: >> >> First, why does this expression have a 'srcref' element: >> >>> exprA <- substitute(function(x) a*x, list(a=2)) >>> print(exprA) >> >> function(x) 2 * x >>> >>> str(as.list(