summaryrefslogtreecommitdiff
path: root/util.lua
diff options
context:
space:
mode:
Diffstat (limited to 'util.lua')
-rw-r--r--util.lua10
1 files changed, 10 insertions, 0 deletions
diff --git a/util.lua b/util.lua
index 5fd41d3..8f1de2a 100644
--- a/util.lua
+++ b/util.lua
@@ -57,6 +57,16 @@ function filter(a, pred)
return filtered
end
+function keys(t)
+ ks = {}
+ i = 1
+ for k, v in pairs(t) do
+ ks[i] = k
+ i += 1
+ end
+ return ks
+end
+
function fmt(x, depth)
depth = depth or 1
if (depth > 4) then return "STACK_OVERFLOW" end