R-alpha: bug in passing of empty (...)
Peter Dalgaard BSA
p.dalgaard@kubism.ku.dk
12 Sep 1997 12:46:35 +0200
Martin Maechler <maechler@stat.math.ethz.ch> writes:
>
> This is too bad (and an old bug at least since 0.49);
> it also breaks some code I have been using in S-plus:
>
> > tst <- function(...) ls(...)
>
> > tst()#--- should really give the same as ls() !!
> character(0)
>
> > ls()
> [1] "%in%" "As.integer" "Dir"
> [4] "Dir0" "Fn12" "Slynx"
> ......
I don't know whether it's a bug or a feature, but it has nothing to do
with (...)
> tst<-function()ls()
> tst()
character(0)
> ls()
[1] "NextMethod" "airquality" "dig" "grid" "l"
[6] "tst" "umach" "x" "xmin" "y"
[11] "z" "זרו"
> tst<-function(...){x<-5;ls(...)}
> tst()
[1] "x"
> tst<-function(){x<-5;ls()}
> tst()
[1] "x"
I'm rather suspecting that pos=-1 in the argument list to ls should
have been pos=1. Anyone have the big picture on pos and envir?
--
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
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-