changes
This commit is contained in:
@@ -28,12 +28,12 @@ function login.cb_uglytimedaemon()
|
||||
|
||||
function time() return ug.get('time') end
|
||||
|
||||
function isa(k1,k2)
|
||||
if k1==k2 then return true end
|
||||
function isa(k1,k2,k3,k4)
|
||||
if k1==k2 or k1==k3 or k1==k4 then return true end
|
||||
if k1==nil then return false end
|
||||
local mt=getmetatable(k1)
|
||||
if not mt then return false end
|
||||
return isa(mt.__index,k2)
|
||||
return isa(mt.__index,k2,k3,k4)
|
||||
end
|
||||
|
||||
function tabcat(t1,t2)
|
||||
@@ -41,9 +41,10 @@ function tabcat(t1,t2)
|
||||
end
|
||||
|
||||
-- Example: multistart(function(t) return tangible.id(t)%3==0 end,function() print("Tangible "..tangible.id(tangible.place()).." here") end)
|
||||
function multistart(filter,closure)
|
||||
function multistart(fil,closure)
|
||||
local lis=tangible.scan('nowhere',0,0,100,false)
|
||||
tabcat(lis,tangible.scan('main',0,0,100,true))
|
||||
local filter=type(fil)=='function' and fil or function(t) return isa(t,fil) end
|
||||
for _,t in ipairs(lis) do if filter(t) then tangible.start(t,closure) end end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user