[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Handling of variables
- From: Erik Hougaard <erik@...>
- Date: Mon, 20 Jan 2014 13:50:00 +0100
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