[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [Challenge] Smallest table copy
- From: Daniel Stephens <daniel@...>
- Date: Wed, 07 May 2014 11:08:55 -0700
Borrowing a trick from above, rearranging slightly, and some _G trickery
- down to 253
local k,o,n,d=next,type,"table"d=function(a,r,t)if n~=o(a)then return a
end t={}r=r or{}r[a]=t for x,y in k,a do x=r[x]or d(x,r)y=r[y]or
d(y,r)t[x]=y end return t end _G[n].copy={shallow=function(a,b)b={}for
x,y in k,a do b[x]=y end return b end,deep=d}