I somehow figured out this brain burning situation, thanks to odow in an other topic.
function test()
v = []
for k = 1:3 # 3 passes here
# associate the pass-local name `item` to `-9`
item = -9
f = function()
println("I'm ", item)
end # `f` is following the pass-local _name_ `item`
# re-bind the pass-local name `item` to `k`
item = k
push!(v, f)
# print the status (note that the latest status of `item` is `k`)
map(x -> x(), v)
# re-bind the pass-local name `item` to `-1`,
# therefore `f` is updated accordingly
item = -1
# `item` is going to lose connection with us,
# therefore the pass-local `f` will not be updated in the future
end
end
test()