lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Follow-up. Just for curiosity.

function f()
  local t = {1}
  function g()
    print (t[1])
  end
  g()		--> 1
  t = {2}
  g()		--> 2
end

f()

This seems to show upvalues are referenced by names (what I called symbolic reference) rather than by address (pointer reference). Else the full replacement of t would not be seen by the closure, as its address has changed.
Is this interpretation correct?


Denis
________________________________

la vita e estrany

http://spir.wikidot.com/