tracks/perl6/exercises/accumulate/example.yaml in trackler-2.1.0.33 vs tracks/perl6/exercises/accumulate/example.yaml in trackler-2.1.0.34
- old
+ new
@@ -19,5 +19,15 @@
[['a1', 'a2', 'a3'], ['b1', 'b2', 'b3'], ['c1', 'c2', 'c3']],
'recursive';
is-deeply accumulate(['the', 'quick', 'brown', 'fox'], sub { @_[0].flip }),
['eht', 'kciuq', 'nworb', 'xof'],
'reverse strings';
+
+unit: module
+example: |
+ sub accumulate (@list, $function) is export {
+ my @accumulated;
+ for @list -> $element {
+ @accumulated.push: $function($element);
+ }
+ return @accumulated;
+ }