[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Documenting Lua gotchas for newbies.
- From: Axel Kittenberger <axkibe@...>
- Date: Wed, 1 Dec 2010 22:12:32 +0100
> and not
Way! I didn't know that, I use table.insert(a, item) everwhere, how
much is the difference?
> 2. (this is more on the "someone tell me the rationale" side)
> I was really puzzled that no library copy operation existed (ie.
> After all the only data structure in Lua are tables, and making shallow or
> deep copies of them is not something one should consider an infrequent
> operation. Only after a while I began to understand the minimalistic
> "philosophy" of Lua.
Not in favor of deep copy, but I suppose a C implementation that
copies the whole hashtable should way effectiver than
for k, v in pairs(table) do
newtable[k] = v
And I do this occassionaly, but maybe you just proven me, that I'm not
actually using the effectivst things?