Course of Raku / Functional, concurrent, reactive, and web programming / Functional programming / Data feeds / Chaining feeds
Quiz — Feeds
What does the following program print?
(10, 20, 30) ==> map(* + 5) ==> my @r;
say @r;| 1 | [15 25 35] |
| 0 | [10 20 30] |
| 0 | [15] |
| 0 | 35 |
The feed sends the list into map(* + 5), which adds five
to each element, and collects the result into @r. So
@r is [15 25 35].