i = 50 function test() i = 10 eval(:i) end test() # => 50
Why does this evaluate to the global i instead of the local one? Is
i
Depending on the application, you could eval the entire function to get at the local value of i such as @simonster describes in this answer.
eval