Skip to content

Commit 3b7ebe5

Browse files
committed
make code compile
1 parent dc17af7 commit 3b7ebe5

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

doc/Type/Signature.pod6

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -467,10 +467,11 @@ sub square-str (Int $x --> Str(Int)) {
467467
for 2,4, *² … 256 -> $a {
468468
say $a, "² is ", square-str( $a ).chars, " figures long";
469469
}
470+
470471
# OUTPUT: «2² is 1 figures long␤
471-
4² is 2 figures long␤
472-
16² is 3 figures long␤
473-
256² is 5 figures long␤»
472+
# 4² is 2 figures long␤
473+
# 16² is 3 figures long␤
474+
# 256² is 5 figures long␤»
474475
=end code
475476
476477
In this example, coercing the return type to C<String> allows us to directly apply string methods, such as the number of characters.

0 commit comments

Comments
 (0)