[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Lua Basics: table duplication?
- From: Adrian Sietsma <adrian_groups@...>
- Date: Mon, 29 Aug 2005 16:14:54 +1000
table.foreach(node, function(k,v) b[k]=clone(v) end)
What would be the benefit of using a closure in this case?
Wouldn't a simple iterator achieve the same effect?
for k,v in pairs(node) do b[a]=v end
Do the enclosure add anything in this case?
probably not - i was just cut&paste the original code.
the real answer is cost of iterator vs cost of callback : profile it &
see...(i don't know the answer)