From p.dalgaard@biostat.ku.dk  Thu Mar  8 21:51:50 2001
From: p.dalgaard@biostat.ku.dk (Peter Dalgaard BSA)
Date: 08 Mar 2001 22:51:50 +0100
Subject: [Rd] surprising behavior of match.arg() (PR#872)
In-Reply-To: Peter Dalgaard BSA's message of "08 Mar 2001 19:43:56 +0100"
References: <200103081827.TAA12196@pubhealth.ku.dk> <x2y9ugt82b.fsf@blueberry.kubism.ku.dk>
Message-ID: <x21ys8gc95.fsf@blueberry.kubism.ku.dk>

Peter Dalgaard BSA <p.dalgaard@biostat.ku.dk> writes:

> Setzer.Woodrow@epamail.epa.gov writes:
> 
> > If a function needs to be passed as an argument to another function,
> > default arguments to the function being passed are lost.  Consider this
> > example:
> 
> Interesting... 
> 
> Apparently, sys.function() is still a promise after the  function has
> been called (and the promise obviously forced).
> Minimal example of same effect:
> 
> > f<-function()sys.function()
> > f()
> function()sys.function()
> > g<-delay(f)
> > g()
> <promise: 0x8b248b4>
> > g<-g
> > g()
> function()sys.function()

Fixed for 1.3.0.

(Not sure I'm happy with this yet. R_sysfunction works on the *call*
of the function, and if the head of the call is a LANGSXP - as in
h(x)(y) - it gets evaluated a second time, and I don't think that
is guaranteed to give the same function as the first time! We really
ought to keep a pointer to the function itself around too.)

	-p

-- 
   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] surprising behavior of match.arg() (PR#872)
Peter Dalgaard BSA