[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Filtering Iterator
- From: Dirk Laurie <dirk.laurie@...>
- Date: Sat, 22 Dec 2012 18:34:36 +0200
2012/12/22 Kevin Martin <kev82@khn.org.uk>:
> I need an iterator wrapper/decorator I can use with for that allows
> me to skip values that don't match a specified predicate. I've done
> a bit of searching, but haven't been able to find one.
Is there a reason why the obvious Lua code is inefficient, obscure
or not applicable?
for k,v in iterator do if predicate(v) then
-- code
end end