Skip to content

Commit 3ac79ec

Browse files
committed
GLR fixes
1 parent 4147056 commit 3ac79ec

File tree

9 files changed

+31
-32
lines changed

9 files changed

+31
-32
lines changed

categories/99-problems/P02-topo.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ =head1 Example
2020
@list[* - 2, * - 1];
2121
}
2222

23-
say last-two(<a b c d e>);
23+
say "{last-two(<a b c d e>)}";
2424

2525
# vim: expandtab shiftwidth=4 ft=perl6

categories/99-problems/P05-topo.pl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
99
=head1 Example
1010
11-
> say reverse-list(<a b c d e>.list);
11+
> say reverse-list(<a b c d e>);
1212
e d c b a
1313
1414
=end pod
@@ -18,7 +18,6 @@ =head1 Example
1818
@list.reverse;
1919
}
2020

21-
# Make sure it's treated as a list, since <> creates a parcel.
22-
say reverse-list(<a b c d e>.list);
21+
say "{reverse-list(<a b c d e>)}";
2322

2423
# vim: expandtab shiftwidth=4 ft=perl6

categories/99-problems/P11-topo.pl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
=head1 Example
1010
1111
> say encode(<a a a a b c c a a d e e e e>.list).perl;
12-
([4, "a"], "b", [2, "c"], [2, "a"], "d", [4, "e"]).list
12+
([4, "a"], "b", [2, "c"], [2, "a"], "d", [4, "e"])
1313
1414
=end pod
1515

@@ -28,6 +28,6 @@ (@list)
2828
}
2929
}
3030

31-
say encode(<a a a a b c c a a d e e e e>.list).perl;
31+
say encode([<a a a a b c c a a d e e e e>]).list.perl;
3232

3333
# vim: expandtab shiftwidth=4 ft=perl6

categories/99-problems/P16-edpratomo.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ (@ary, $n)
2121
gather for 1 .. @ary.elems -> $i { take @ary[$i - 1] if $i % $n }
2222
}
2323

24-
drop(<A B C D E F G H I K>, 3).perl.say;
24+
drop(<A B C D E F G H I K>, 3).list.perl.say;
2525

2626
# vim: expandtab shiftwidth=4 ft=perl6

categories/99-problems/P23-topo.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ =head1 Example
1717
@list.pick($amount);
1818
}
1919

20-
say get-rand-elems(<a b c d e>, 3);
20+
say "{get-rand-elems(<a b c d e>, 3)}";
2121

2222
# vim: expandtab shiftwidth=4 ft=perl6

categories/99-problems/P24-topo.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ =head1 Example
2121
}
2222
}
2323

24-
say lotto-select(6, 49);
24+
say "{lotto-select(6, 49)}";
2525

2626
# vim: expandtab shiftwidth=4 ft=perl6

categories/99-problems/P36-ovid.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ =head1 Example
118118
}
119119

120120
for 17, 53, 90, 94, 200, 289, 62710561 -> $number {
121-
say "Prime factors of $number are: ", prime-factors($number).sort.perl;
121+
say "Prime factors of $number are: ", prime-factors($number).perl;
122122
}
123123

124124
# vim: expandtab shiftwidth=4 ft=perl6

categories/99-problems/P36-rhebus.pl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ (Int $n)
4141
}
4242
}
4343

44-
say prime_factors_mult($_).perl for 1..20;
45-
prime_factors_mult(315).perl.say;
46-
prime_factors_mult(1723).perl.say;
44+
say prime_factors_mult($_).list.perl for 1..20;
45+
prime_factors_mult(315).list.perl.say;
46+
prime_factors_mult(1723).list.perl.say;
4747

4848
# vim: expandtab shiftwidth=4 ft=perl6

t/categories/99-problems.t

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,8 @@ sub expected-output {
248248
END
249249

250250
%expected-output{"P19-topo.pl"} = q:to/END/;
251-
["d", "e", "f", "g", "a", "b", "c"]<>
252-
["e", "f", "g", "a", "b", "c", "d"]<>
251+
["d", "e", "f", "g", "a", "b", "c"]
252+
["e", "f", "g", "a", "b", "c", "d"]
253253
END
254254

255255
%expected-output{"P20-rhebus.pl"} = q:to/END/;
@@ -418,38 +418,38 @@ sub expected-output {
418418
END
419419

420420
%expected-output{"P36-ovid.pl"} = q:to/END/;
421-
Prime factors of 17 are: ("17" => 1,)
422-
Prime factors of 53 are: ("53" => 1,)
421+
Prime factors of 17 are: ("17" => 1)
422+
Prime factors of 53 are: ("53" => 1)
423423
Prime factors of 90 are: ("2" => 1, "3" => 2, "5" => 1)
424424
Prime factors of 94 are: ("2" => 1, "47" => 1)
425425
Prime factors of 200 are: ("2" => 3, "5" => 2)
426-
Prime factors of 289 are: ("17" => 2,)
427-
Prime factors of 62710561 are: ("7919" => 2,)
426+
Prime factors of 289 are: ("17" => 2)
427+
Prime factors of 62710561 are: ("7919" => 2)
428428
END
429429

430430
%expected-output{"P36-rhebus.pl"} = q:to/END/;
431431
()
432-
(2 => 1,)
433-
(3 => 1,)
434-
(2 => 2,)
435-
(5 => 1,)
432+
(2 => 1)
433+
(3 => 1)
434+
(2 => 2)
435+
(5 => 1)
436436
(2 => 1, 3 => 1)
437-
(7 => 1,)
438-
(2 => 3,)
439-
(3 => 2,)
437+
(7 => 1)
438+
(2 => 3)
439+
(3 => 2)
440440
(2 => 1, 5 => 1)
441-
(11 => 1,)
441+
(11 => 1)
442442
(2 => 2, 3 => 1)
443-
(13 => 1,)
443+
(13 => 1)
444444
(2 => 1, 7 => 1)
445445
(3 => 1, 5 => 1)
446-
(2 => 4,)
447-
(17 => 1,)
446+
(2 => 4)
447+
(17 => 1)
448448
(2 => 1, 3 => 2)
449-
(19 => 1,)
449+
(19 => 1)
450450
(2 => 2, 5 => 1)
451451
(3 => 2, 5 => 1, 7 => 1)
452-
(1723 => 1,)
452+
(1723 => 1)
453453
END
454454

455455
%expected-output{"P37-rhebus.pl"} = q:to/END/;

0 commit comments

Comments
 (0)