aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
Diffstat (limited to 'util')
-rw-r--r--util/array.lua5
1 files changed, 5 insertions, 0 deletions
diff --git a/util/array.lua b/util/array.lua
index 8b9102bf..05e035df 100644
--- a/util/array.lua
+++ b/util/array.lua
@@ -5,6 +5,11 @@ local function new_array(_, t)
return setmetatable(t or {}, array_mt);
end
+function array_mt.__add(a1, a2)
+ local res = new_array();
+ return res:append(a1):append(a2);
+end
+
setmetatable(array, { __call = new_array });
function array:map(func, t2)