]> git.lizzy.rs Git - metalua.git/commitdiff
fixed iall and iany in table2
authorFabien Fleutot <fabien@macfabien.local>
Tue, 12 Feb 2008 23:05:42 +0000 (00:05 +0100)
committerFabien Fleutot <fabien@macfabien.local>
Tue, 12 Feb 2008 23:05:42 +0000 (00:05 +0100)
src/lib/table2.lua

index 7383cbce9150e5ce786636eae1c8eabcb2370961..f5ea84f2e16ee19943e0f3f7b73b3d85af0e44bd 100644 (file)
@@ -103,24 +103,16 @@ function table.isub (t, ...)
    return u
 end
 
---[[
 function table.iall (f, ...)
    local result = true
    local function g(...) return not f(...) end
-   table.iforeach(g, ...)
-   return result
+   return not table.iforeach(g, ...)
+   --return result
 end
 
 function table.iany (f, ...)
    local function g(...) return not f(...) end
-   return table.iall(g, ...)
-end
-]]
-
-function table.inverse (t)
-   local i = { }
-   for a, b in pairs(t) do i[b]=a end
-   return i
+   return not table.iall(g, ...)
 end
 
 function table.shallow_copy(x)