|
I'm getting some results I was not expecting with this code. functionList = {} for i=1, 10 do functionList[ i ] = function()print( i ) end
end for i=1, 10 do functionList[ i ]() endI get ten 10's printed out. As I understand closures I would have expected 1 to 10. Could someone enlighten me as to what is wrong?
Thanks. Jack