Version: 4.2.0.5
11 for variants
(require (planet untyped/unlib/for)) |
(for/fold/reverse ([accum-id accum-expr] ) ([sequence-id sequence-expr] ) expr ) |
Like for/fold, but calls reverse on each accum-id after iteration is complete.
Example: | |||||||
| |||||||
(2 4 6 8) | |||||||
(1 3 5 7 9) |
(for/fold1 ([accum-id accum-expr] ) ([sequence-id sequence-expr] ) expr ) |
Like for/fold, but returns only the value of the first accum-id.
Example: | |||||||
| |||||||
(8 6 4 2) |
(for/fold1/reverse ([accum-id accum-expr] ) ([sequence-id sequence-expr] ) expr ) |
Like for/fold1, but returns the reverse of the first accum-id.
Example: | |||||||
| |||||||
(8 6 4 2) |
(for/filter ([sequence-id sequence-expr] ) expr ) |
Like for/list, but only accumulates non-#f return values.
Example: | ||
| ||
(2 4 6 8) |
(for/append ([sequence-id sequence-expr] ) expr ) |
Like for/list, but appends the results into a list.
Example: | ||
| ||
(1 2 2 4 3 6 4 8) |