From p.dalgaard@biostat.ku.dk  Thu Aug 24 23:41:27 2000
From: p.dalgaard@biostat.ku.dk (Peter Dalgaard BSA)
Date: 25 Aug 2000 00:41:27 +0200
Subject: [Rd] Method dispatch fails for autoloaded methods (PR#642)
In-Reply-To: Thomas Lumley's message of "Thu, 24 Aug 2000 10:08:09 -0700 (PDT)"
References: <Pine.GSO.4.21.0008241005070.19023-100000@atlas.biostat.washington.edu>
Message-ID: <x2lmxm1duw.fsf@blueberry.kubism.ku.dk>

Thomas Lumley <thomas@biostat.washington.edu> writes:

> On Thu, 24 Aug 2000 maechler@stat.math.ethz.ch wrote:
> 
> > (As mentioned before, on R-devel)
> > 
> > This code snippet shows what the Subject above says :
> 
> The problem is that isFunction is false for diff.ts, since it is only a
> promise, not a function.
> 
> I think the solution is for usemethod to force the promise (in lines 225ff
> of objects.c), but I'm not sure how to do this.

Yes, must be the right thing to do. We must be doing the same thing
with regular function lookups, no? Not that there are many (if any)
relevant cases, but

> autoload(".TkRoot","tcltk")
> .TkRoot(x)
Error: couldn't find function ".TkRoot"

will cause the .TkRoot promise to be forced, loading tcltk *before* it
can figure out that it isn't a function. I see no reason for object
methods to behave any differently.

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)             FAX: (+45) 35327907
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


[Rd] Method dispatch fails for autoloaded methods (PR#642)
Peter Dalgaard BSA