Course of Raku / Functional, concurrent, reactive, and web programming / Concurrent programming / Junctions / Exercises / All even

Solution: All even

Here is a possible solution to the task.

Code

say so all(2, 4, 6) %% 2;

🦋 You can find the source code in the file all-positive.raku.

Output

True

Comments

  1. The test autothreads: %% 2 is applied to each value, and the all junction requires every one to pass.

  2. All three numbers are even, so the result is True. If even one were odd, it would be False.

Course navigation

All even   |   None negative