Course of Raku / Functional, concurrent, reactive, and web programming / Functional programming / Lambdas and closures / Exercises
A multiplier
Problem
Write a subroutine multiplier that takes a factor and
returns a closure multiplying its argument by that factor. Build a
“times three” function and call it with 4.
Example
The program prints:
12