lua-users home
lua-l archive

Re: hpairs?

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On 28/12/2010 9.25, Dirk Laurie wrote:
How does one iterate over all the keys of a table _except_
the ones that ipairs would reach?
(slow and untested):
local skip = {}
for i, _ in ipairs(t) do
 skip[i] = true
end
for k, v in pairs(t) do
 if not skip[k] do
 -- something
 end
end
--
 Enrico

AltStyle によって変換されたページ (->オリジナル) /