Re: Filtering Iterator
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: Filtering Iterator
- From: Dirk Laurie <dirk.laurie@...>
- Date: 2012年12月22日 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