Skip to content

Instantly share code, notes, and snippets.

@nefftd
Created March 10, 2015 18:00
Show Gist options
  • Save nefftd/c29f49f7b3c0cbf4a65c to your computer and use it in GitHub Desktop.
Save nefftd/c29f49f7b3c0cbf4a65c to your computer and use it in GitHub Desktop.
local function cleverinsert(tbl, a, b, ...)
if a == nil then return tbl end
tbl[a] = b
return cleverinsert(tbl, ...)
end
print( unpack( cleverinsert({}, 1,'a', 2,'b', 3,'c') ) )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment