Skip to content
Prev 163968 / 398506 Next

unexpected scoping behavior with functions created in a loop

The missing item is lazy evaluation.  Try forcing the evaluation of i
and then repeat:

makeF <- function(i) { force(i); function() i }


On Sat, Dec 6, 2008 at 9:22 PM, Antonio, Fabio Di Narzo
<antonio.fabio at gmail.com> wrote: