Re: [Rd] Curry: proposed new functional programming, er, function.

2012-05-30 Thread Yike Lu
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:

Re: [Rd] Curry: proposed new functional programming, er, function.

2012-05-26 Thread Yike Lu
On 5/25/12 5:23 PM, Hadley Wickham wrote: On Fri, May 25, 2012 at 3:14 PM, Yike Lu wrote: So here's the way I'm reading this: Original: curry_call is the function body you're constructing, which is itself just a one liner which calls the symbol FUN with the appropriate subst

Re: [Rd] Curry: proposed new functional programming, er, function.

2012-05-25 Thread Yike Lu
So here's the way I'm reading this: Original: curry_call is the function body you're constructing, which is itself just a one liner which calls the symbol FUN with the appropriate substitutions. call("function", [...]) calls the "function" function, which itself takes 2 arguments: the list o

Re: [Rd] Curry: proposed new functional programming, er, function.

2012-05-24 Thread Yike Lu
Hadley Wickham-2 wrote > > Curry <- function(FUN, ...) { > args <- match.call(expand.dots = FALSE)$... > args$... <- as.name("...") > > env <- parent.frame() > > if (is.name(FUN)) { > fname <- FUN > } else if (is.character(FUN)) { > fname <- as.