lua-users home
lua-l archive

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


* On Sat Mar 30 18:48:27 +0100 2013, Mason Mackaman wrote:
 
> shouldn't 'local cloneset=set' create a local table named 'cloneset'
> that is an exact copy of the input? And if 'set' is just a reference
> to the input, what does making it local do? 

local cloneset = set creates a new variable 'cloneset' which is a
reference to the same table as 'set'. Modyfying 'cloneset' will thus
modify 'set'.

> Maybe I'm not quite understanding how functions work in Lua.

If you're not sure how things fit together, you might want to check the
manual: http://www.lua.org/pil/4.2.html




-- 
:wq
^X^Cy^K^X^C^C^C^C