Course of Raku / Advanced /
Debugging / Turning values into text / The .Str
method
Quiz — gist and Str
What does the following program print?
my @a = 1, 2, 3;
say @a.Str;| 0 | [1 2 3] |
| 1 | 1 2 3 |
| 0 | (1 2 3) |
| 0 | 1, 2, 3 |
.Str gives the plain string form, where the elements are
simply joined by spaces with no brackets: 1 2 3. The
bracketed form [1 2 3] is what .gist (and
therefore say @a) would produce.