pred
.functional :: FilterIter :: defaultinit
functional :: FilterIter :: pred
functional :: FilterIter :: pred=
functional $ FilterIter :: SELF
Type of this instance, automatically specialized in every classfunctional $ FilterIter :: init
functional :: FilterIter :: defaultinit
functional :: FilterIter :: pred
functional :: FilterIter :: pred=
# An tierator that filter its element by a predicate `pred`.
class FilterIter[E]
super FunIter[E,nullable E]
var pred: Fun1[E, Bool]
redef init
do
if is_ok and not pred.call(my_iter.item) then next
end
redef fun item
do
assert is_ok
return my_iter.item
end
redef fun next
do
loop
my_iter.next
if not is_ok then
break
end
var x = my_iter.item
if pred.call(x) then
break
end
end
end
end
lib/functional/iter_extras.nit:279,1--308,3