lua-users home
lua-l archive

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


second = table will just create a extra refence (sort of pointer) so that both "second" and "table" refeers to the same object.

/Erik

Maxime Petazzoni wrote:

Hi,

I have two little questions that I hope you'll be able to answer :

- When a create an table and then make a copy of it :

local table = { }
second = table

Does a change on table will be propagated to second ?

- When I see this :

local table = { }

function table.test ()
 print("Mooh !")
end

Does it creates a function test inside the table 'table' ?

Thanks,
- Sam