Re: lambda error update (PR#282)

About this list Date view Thread view Subject view Author view Other groups

Subject: Re: lambda error update (PR#282)
From: Peter Dalgaard BSA (p.dalgaard@biostat.ku.dk)
Date: Sat 18 Sep 1999 - 20:21:42 EST


Message-ID: <x2yae4zfih.fsf@blueberry.kubism.ku.dk>

p.dalgaard@biostat.ku.dk writes:

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

Heh. Turned out to be absolutely trivial:

diff -u -r1.62.2.1 eval.c
--- eval.c 1999/09/02 15:11:59 1.62.2.1
+++ eval.c 1999/09/18 10:06:30
@@ -691,7 +691,7 @@
 {
     SEXP rval;
 
- if (length(args) < 3)
+ if (length(args) < 2)
        WrongArgCount("lambda");
     CheckFormals(CAR(args));
     rval = mkCLOSXP(CAR(args), CADR(args), rho);

If the 3rd argument is absent, R_NilValue gets passed for the CADDR in

   setAttrib(rval, R_SourceSymbol, CADDR(args));

and that is exactly what should happen!

This has to be the smallest bugfix possible, AFAICS a single bit gets
flipped, both in the source and in the binaries....

Will commit in a moment.

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


About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b25 : Tue 04 Jan 2000 - 14:16:08 EST