From p.dalgaard@biostat.ku.dk  Wed Nov 22 12:35:47 2000
From: p.dalgaard@biostat.ku.dk (Peter Dalgaard BSA)
Date: 22 Nov 2000 13:35:47 +0100
Subject: [Rd] How do you construct a function from a list?
In-Reply-To: Kurt Hornik's message of "Wed, 22 Nov 2000 13:08:26 +0100"
References: <3a1a7d56.44981237@smtp1.sympatico.ca> <14875.46906.371747.98635@mithrandir.hornik.net>
Message-ID: <x2n1esp4kc.fsf@blueberry.kubism.ku.dk>

Kurt Hornik <Kurt.Hornik@ci.tuwien.ac.at> writes:

> > (This might be a bug in as.function, because 
> 
> >   as.function(c(alist(a=,b=2),forloop))
> 
> > returns the expected function
....
> Re the above, I guess Peter would know more about this but is currently
> swamped with other work.

He is, but this (do_asfunction in coerce.c) looks wrong:

    if( n == 1 )
        args =  mkCLOSXP(args, arglist, envir);
    else
        args =  mkCLOSXP(args, VECTOR_ELT(arglist, n - 1), envir);
    UNPROTECT(1);

-- 
   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] How do you construct a function from a list?
Peter Dalgaard BSA