summaryrefslogtreecommitdiff
path: root/xmake/core/base/table.lua
diff options
context:
space:
mode:
authorOpportunityLiu <[email protected]>2019-06-19 19:51:14 +0800
committerOpportunityLiu <[email protected]>2019-06-19 19:51:14 +0800
commit608f198b3ab87f83b2458e58c1f7dcc6a2beebc0 (patch)
tree0bc0a7e2dbc692e7b1542bc88a4f476791158828 /xmake/core/base/table.lua
parent526556809d220564e6565fbe2c6deec723c9f343 (diff)
add table.pack
Diffstat (limited to 'xmake/core/base/table.lua')
-rw-r--r--xmake/core/base/table.lua10
1 files changed, 10 insertions, 0 deletions
diff --git a/xmake/core/base/table.lua b/xmake/core/base/table.lua
index e21680379..3fd35c082 100644
--- a/xmake/core/base/table.lua
+++ b/xmake/core/base/table.lua
@@ -256,5 +256,15 @@ function table.unique(array, barrier)
return array
end
+-- pack arguments into a table
+function table.pack(...)
+ return { n = select("#", ...), ... }
+end
+
+-- unpack table values
+function table.unpack(list, i, j)
+ return unpack(list, i, j)
+end
+
-- return module: table
return table