I just realized that even in the non-nested case, calling from top level
"broke" some of my code "inexplicably", since the globally stored
function call gets overridden if you call Curry again. So old Curried
functions break.
Glad to have this fix.
On 5/25/2012 5:23 PM, Hadley Wickham wrote:
call("function", [...]) calls the "function" function, which itself takes 2
arguments: the list of formal args and the function body.
eval of this call returns the newly constructed function, which you assign
to f. Then you assign the parent.frame() as the environment of f, except
with the symbol FUN assigned as the original argument FUN.
However, upon looking at the debugger, I find that env$FUN<-FUN assigns FUN
in Global Scope if Curry is called from the top level.
A nested Curry call then creates FUN=function(...) FUN([...]), a recursive
infinite loop.
Yes, that was a really bad idea - not sure why I didn't see the
problems when I first wrote it.
______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel