R-alpha: R-0.50-a3(+) Method despatching bug ?
Thomas Lumley
Thomas Lumley <thomas@biostat.washington.edu>
Wed, 20 Aug 1997 10:34:35 -0700 (PDT)
On Wed, 20 Aug 1997, Martin Maechler wrote:
> It is very wierd... Can some of you confirm the following behavior ?
> It is a new bug (feature ?) which was not yet in 0.49 ...
>
I'm not sure that you can expect NextMethod to work if you fiddle with the
class list...
However, there is still something wrong with method dispatching, since
print.noquote <- function (obj, ...) NextMethod(quote = FALSE,...)
doesn't work either. The error occurs when R tries for some reason to
make a recursive call to print.noquote.
Using debug() also shows the interesting fact that
R> nq
calls print() with its arguments evaluated
------
debugging in: print(structure(c("a", "b", "c", "d", "e", "f", "g", "h",
"i",
"j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v",
"w", "x", "y", "z"), class = "noquote"))
debugging in: print.noquote(structure(c("a", "b", "c", "d", "e", "f", "g",
"h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t",
"u", "v", "w", "x", "y", "z"), class = "noquote"))
Error: couldn't find function "print.noquote"
-------
but
----------
R> print(nq)
print(nq)
debugging in: print(nq)
debugging in: print.noquote(nq)
[1] a b c d e f g h i j k l m n o p q r s t u v w x y z
attr(,"class")
[1] noquote
exiting from: print.noquote(nq)
exiting from: print(nq)
----------
doesn't evaluate the argument first.
Thomas Lumley
------------------------------------------------------+------
Biostatistics : "Never attribute to malice what :
Uni of Washington : can be adequately explained by :
Box 357232 : incompetence" - Hanlon's Razor :
Seattle WA 98195-7232 : :
------------------------------------------------------------
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
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
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-