Anonymous user
Filter: Difference between revisions
m
→Idiomatic approach
m (→Destructively) |
|||
Line 1,134:
Idiomatic approach in Dy is to use non-strict iterators (which can be combined without intermedate data structures) and translate the result to an array if needed:
<lang Dyalect>func Iterator.
for x in this when pred(x) {
yield x
Line 1,140:
}
func Iterator.
for x in this {
yield proj(x)
Line 1,147:
var xs = [1..20]
var arr = xs.
print(arr.
{{out}}
|