lua-users home
lua-l archive

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


Hi Luiz
 
Thanks for the speedy reply
 
> This is simpler:
> acme={graphics=graphics}
> graphics=nil
 
Ooops, yes that is the better way of doing it. I did type that originally but I changed it as I wrongly thought the following graphics = nil line would cause the acme table to get its graphics table entry also deleted. Newbie alert ! Smile
 
Anyway, the main gist of my question still applies, which of the 3 options listed is the better way of doing this?
 
Regards Geoff 
 
PS. looks like I double posted somehow, sorry not sure what caused that.

 
> Date: Wed, 23 Feb 2011 18:34:18 -0300
> From: lhf@tecgraf.puc-rio.br
> To: lua-l@lists.lua.org
> Subject: Re: Namespace advice needed
>
> > -- for each table I need to move,
> > acme={}
> > acme.graphics={}
> > for k,v in pairs(graphics) do
> > acme.graphics[k] = v
> > end
> > graphics = nil
>
> This is simpler:
> acme={graphics=graphics}
> graphics=nil
>