RosettaCodeData/Task/First-class-functions/Dyalect/first-class-functions-3.dyalect
2023-07-01 13:44:08 -04:00

7 lines
133 B
Text

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