R-alpha: "invisible" (yet again): a more problematic bug[let]

Martin Maechler Martin Maechler <maechler@stat.math.ethz.ch>
Thu, 6 Nov 1997 09:12:47 +0100


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
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=