lambda error update (PR#282)

p.dalgaard@biostat.ku.dk p.dalgaard@biostat.ku.dk
Sat, 18 Sep 1999 11:40:00 +0200 (MET DST)


Matthew Wiener <mcw@ln.nimh.nih.gov> writes:

> > parameters (xxdefun in gram.y calls lang4). The arg count got changed
> > from 0.64.2 to 0.65.0 (from 3 to 4) to accommodate the stored source
> > attribute. I suppose that a function stored in a saved workspace might
> > cause some kind of mess when restored.
> > 
> 
> If I understand this correctly, it would seem to mean that I'm unlikely to
> get this error more than once from any given function, since when I
> re-store (rather than restore) it under 0.65.0 things will get fixed.
> Does that seem right?  If not, is there anything I can do?

No, that doesn't work, because you'll just store the old call again.
However if you just edit the function, e.g. with fix(), the problem
goes away. You don't have to change it, just make sure that the code
gets reparsed.

Here's the essence of the problem:

R : Copyright 1999, The R Development Core Team
Version 0.64.1 Patched (unreleased snapshot) (May 14, 1999)
> f<-function(){g<-function()2}  
> save(f,file="xxx")

R : Copyright 1999, The R Development Core Team
Version 0.65.0 Patched (unreleased) (September 16, 1999)
> load("xxx")
> f
function () 
{
    g <- function() 2
}
> f()
Error: incorrect number of arguments to "lambda"
> fix(f)
...
> f()
>

D*mn! I should have thought of that. I'll see if I can cook up a fix
for 0.65.1. Filed as a bug report.

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