lua-users home
lua-l archive

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


On 20-01-2014 13:32, Hendrik Werner wrote:
figured it may have something to do with the fact that "b = a" does not actually create another variable but another reference to the anonymous value a references (that's the way it works, right?) so the implicit definition "local a = a" in my function header also just creates another reference to the same anonymous value thus also changes that value, is that right so far?
Yes, it is the same *value* - so you need to clone (dep clone perhaps) if you want to copy the value.

http://lua-users.org/wiki/CopyTable

/e