RosettaCodeData/Task/First-class-functions/Dyalect/first-class-functions-3.dyalect

8 lines
133 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
func Iterator.Filter(pred) {
for x in this when pred(x) {
yield x
}
}
[1,2,3,4,5].Iterate().Filter(x => x % 2 == 0)