|
|
||
|
Can someone please explain the following.
Given:
t={"hi"}
for k,v in t do f=function() print(v) end end
f()
Actual output:
nil
Expected output:
hi
How do I create the function closure with the value v has when the
closure is created?
Thanks,
Curt