Skip to content
This repository has been archived by the owner on Jul 28, 2022. It is now read-only.

Commit

Permalink
util.merge function that creates a table with the sum of contents of …
Browse files Browse the repository at this point in the history
…the arguments
  • Loading branch information
Fabio Mascarenhas committed Mar 24, 2010
1 parent 373e77f commit ea62a8c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/mk/util.lua
Expand Up @@ -127,4 +127,14 @@ function util.htmlify(func)
setfenv(func, env)
end

function util.merge(...)
local t = {}
for _, tab in ipairs{ ... } do
for k, v in pairs(tab) do
t[k] = v
end
end
return t
end

return util

0 comments on commit ea62a8c

Please sign in to comment.