Martin Maechler
1997-Nov-06 08:12 UTC
R-alpha: "invisible" (yet again): a more problematic bug[let]
I think this is a more problematic buglet in (implicit/explicit) ``invisible behavior''). Try this (all versions of R from 0.49 to 0.60): test0 <- function() c(1,2) test <- function(two = FALSE) c(1, if(two) 2) testR <- function(two = FALSE) return(c(1, if(two) 2)) test0()# 1 2 as it should test() # <<<<<<<<<<<<<<<<<<<<<< INVISIBLE! @#$@! test(T)# 1 2 print(test()) print(test(T)) testR() # ok; NOT invisible... testR(T)# 1 2 --------------------------- Even though it is not really harmful once you know about it, it can be pretty wierd when you try and test functions... -- Martin =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-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 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Martyn Plummer
1997-Nov-06 09:28 UTC
R-alpha: "invisible" (yet again): a more problematic bug[let]
maechler@stat.math.ethz.ch wrote:> > Try this (all versions of R from 0.49 to 0.60): > > test0 <- function() c(1,2) > test <- function(two = FALSE) c(1, if(two) 2) > testR <- function(two = FALSE) return(c(1, if(two) 2)) > > test0()# 1 2 as it should > test() # <<<<<<<<<<<<<<<<<<<<<< INVISIBLE! @#$@! > test(T)# 1 2 > print(test()) > print(test(T)) > > testR() # ok; NOT invisible... > testR(T)# 1 2The problem seems to be in do_if (eval.c) where the R_Visible flag is set to 0. Set it to 1 instead and your functions will work properly. You also get R>if(F) 2 NULL instead of R>if(F) 2 R> which is consistent with S-PLUS. Martyn =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-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 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Possibly Parallel Threads
- R-alpha: "invisible" : R_INVISIBLE .. -- repeat{} gives BOMB
- samba 3.0 beta3 ldapsam bug ?!?!
- R-alpha: buglet in return(invisible()) [R 0.50 and 0.60]
- Win 64 package build - ERROR: loading failed for 'x64'
- Bug#784810: Bug#784810: Xen domU try ton access to dom0 LVM Volume group