Skip to content
Prev 2045 / 63424 Next

R's UseMethod() does not dispatch on changed class() (PR#167)

Robert Gentleman <rgentlem@hsph.harvard.edu> writes:
No. It means that S's implementation is quite wrong...

R's substitute works by fairly clean rules of (lazy) evaluation: If
you pass it a an expression containing x and x is a PROMSXP, you get
the argument expression. If you change x before the substitute, you get
the current value (unless you used x<-delay(something), in which case
you get the unevaluated something). 

S does --- something else:
[1] 2
y

This, I *really* don't think we want to emulate.

The documentation is badly off, though... and the quote() doc is
really off target. (I've written about this before, but it never found
its way to the help page, obviously).