about summary refs log tree commit diff stats
path: root/util.lua
diff options
context:
space:
mode:
Diffstat (limited to 'util.lua')
-rw-r--r--util.lua14
1 files changed, 10 insertions, 4 deletions
diff --git a/util.lua b/util.lua index 938848c..b5a57b1 100644 --- a/util.lua +++ b/util.lua
@@ -1,11 +1,17 @@
1--- lam.util 1--- lam.util
2 2
3local util = {} 3local m = {}
4local unpack = table.unpack or unpack
5 4
6function util.pop (tbl) 5function m.pop (tbl)
6 --[[ Remove the first element from TBL. ]]
7 return table.remove(tbl, 1) 7 return table.remove(tbl, 1)
8end 8end
9 9
10function m.arity (r, min, max)
11 --[[ Return whether R is within MIN and MAX (inclusive). ]]
12 local len = #r
13 return len >= min and len <= max
14end
15
10--- 16---
11return util 17return m