When you run a for loop, this creates a variable in the environment in which the loop is running, and the functions created in the loop also run from that environment. Therefore, whenever you run functions created in this way that use the index value from the loop, they only have access to the final value, and only as long as this varaible remains (try rm(i) and try to entertain one of the functions to the list).
What you need to do is bind the index value to a function in their own environment. lapply will do this automatically. However, there is gotcha with a lazy rating. What you need to do is also force i score before creating an anonymous function:
funclist <- lapply(1:5, function(i) {force(i); function(x) print(i)}) funclist[[1]]('foo') [1] 1 funclist[[5]]('foo') [1] 5
James source share