Details
Description
Add a reverse_each(iterable) function that takes one argument and an optional block. The declared parameter type must be `Iterable`.
If the function is called without a block, it must return a new iterable that will yield each element of the given argument in reverse order.
When a block is given, it must be called with each element of the given argument in reverse order. The argument is then returned.
Example:
[1,3,5,7].reverse_each |$x| { notice($x) } |
will result in the notices '7', '5', '3', '1'
$c = [1,3,5,7].reverse_each.map |$x| { $x * 10 } |
Will result in:
$c == [70, 50, 30, 10]. |