From rgentlem@hsph.harvard.edu  Thu Apr 15 21:32:28 1999
From: rgentlem@hsph.harvard.edu (Robert Gentleman)
Date: Thu, 15 Apr 1999 16:32:28 -0400 (EDT)
Subject: R's UseMethod() does not dispatch on changed class() (PR#167)
In-Reply-To: <x2aew9g6ox.fsf@blueberry.kubism.ku.dk>
Message-ID: <Pine.SV4.4.05.9904151628020.16888-100000@hsph.harvard.edu>



On 15 Apr 1999, Peter Dalgaard BSA wrote:

> Erm, does that cover this case?:
> 
> >  f<-function(x){x<-2;print(substitute(x));UseMethod("print")}  
> > f(4)
> [1] 2
> [1] 4
> > f((4))
> (4)
> [1] 2
> 
> (It may, I'm just too tired to see it...)

  Wow! That's peculiar. 
  R does the rather boring

> f<-function(x){x<-2;print(substitute(x));UseMethod("print")}
> f(4)
[1] 2
[1] 4
> f((4))
[1] 2
[1] 4

  Does that mean that our implementaion of substitute is not quite
right? The documentation suggests that you get the expression typed as
the value of a formal argument; right now we're getting the current
value.

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


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