move FPS functions together, remove debug statement
#!/usr/bin/env lua
-local pp = require'std'.tostring
-
local _ENV = {
LUAVERSION = _VERSION:gsub('[^0-9%.]+', ''),
append = table.insert,
@@ -205,6 +203,15 @@ local function case(s, branches)
end
+local function collect(keylist, dict)
+ local r = {}
+ for k in each(keylist) do
+ r[k] = dict[k]
+ end
+ return r
+end
+
+
local function contains(seq, v)
for i = 1, int(seq.n) or len(seq) do
if seq[i] == v then
@@ -248,6 +255,15 @@ local function filter(seq, block)
end
+local function hoist(keylist, dict)
+ local r = {}
+ for k in each(keylist) do
+ merge(r, dict[k])
+ end
+ return not isempty(r) and r or nil
+end
+
+
local function id(...)
return ...
end
@@ -471,24 +487,6 @@ do
end
-local function collect(keylist, dict)
- local r = {}
- for k in each(keylist) do
- r[k] = dict[k]
- end
- return r
-end
-
-
-local function hoist(keylist, dict)
- local r = {}
- for k in each(keylist) do
- merge(r, dict[k])
- end
- return not isempty(r) and r or nil
-end
-
-
local function per_platform(t)
local r = {}
for k, v in next, t do
