lua-users home
lua-l archive

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


On 8 November 2012 17:53, David Given <dg@cowlark.com> wrote:
> Therefore:
>
> a = a + 1
>
> ...does not *change* the value of the thing a points at. Instead it
> creates a new number with the value (a+1) and then reassigns a to point
> at the new number instead of the old one.

How did you come to this conclusion ?
'a' is a place on the stack, yes a temp lua_Number is created to store
the result of a+1 yet 'a'(stack slot) is then assigned the value of
this temp.

--Liam