mirror of
https://github.com/kepler155c/opus
synced 2025-01-01 03:10:28 +00:00
array api
This commit is contained in:
parent
e5312ca6ab
commit
cd6ed79d11
13
sys/apis/array.lua
Normal file
13
sys/apis/array.lua
Normal file
@ -0,0 +1,13 @@
|
||||
local Array = { }
|
||||
|
||||
function Array.filter(it, f)
|
||||
local ot = { }
|
||||
for _,v in pairs(it) do
|
||||
if f(v) then
|
||||
table.insert(ot, v)
|
||||
end
|
||||
end
|
||||
return ot
|
||||
end
|
||||
|
||||
return Array
|
Loading…
Reference in New Issue
Block a user