func Iterator.Filter(pred) { for x in this when pred(x) { yield x } } [1,2,3,4,5].Iterate().Filter(x => x % 2 == 0)