Skip to content

Commit 77a1beb

Browse files
author
Jan-Olof Hendig
committed
Fixed a few typos
1 parent 53c9c91 commit 77a1beb

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

doc/Language/traps.pod6

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ For example
6767
6868
dies with
6969
70-
Cannot modify an immutable Int
70+
Cannot assign to an immutable value
7171
7272
in the first line marked with C<# WRONG>, because C<$.x>, short for C<$(
7373
self.x )>, is a call to a read-only accessor.
@@ -236,7 +236,7 @@ than requiring every element to be checked on every call.
236236
237237
=head2 Quotes and interpolation
238238
239-
Interpolation in string literals can be too clever for your good.
239+
Interpolation in string literals can be too clever for your own good.
240240
241241
"$foo<html></html>" # Perl 6 understands that as:
242242
$foo<html> ~ '</html>'
@@ -255,7 +255,7 @@ without using C<Q:c> as your quoting construct.
255255
256256
There are methods that Str inherits from Any that work on iterables like lists. Iterators on Strings contain one element that is the whole string. To use C<sort>, C<reverse> and friends, you need to split the string into a list first.
257257
258-
say "cba".sort; # OUTPUT: «cba␤» (what is wrong)
258+
say "cba".sort; # OUTPUT: «(cba)␤» (what is wrong)
259259
say "cba".comb.sort.join; # OUTPUT: «abc␤»
260260
261261
=head1 Operators
@@ -272,25 +272,25 @@ bitwise operators in Perl 6 are: C<+^>, C<+|>, C<+&> for integers and C<?^>, C<
272272
In some languages, using strings as range end points, considers the entire string when figuring out what the next string
273273
should be; loosely treating the strings as numbers in a large base. Here's Perl 5 version:
274274
275-
say join ", ", "az".."bc"
275+
say join ", ", "az".."bc";
276276
az, ba, bb, bc
277277
278278
Such a range in Perl 6 will produce a different result, where I<each letter> will be ranged to a corresponding letter in the
279279
end point, producing more complex sequences:
280280
281-
say join ", ", "az".."bc"'
281+
say join ", ", "az".."bc";
282282
az, ay, ax, aw, av, au, at, as, ar, aq, ap, ao, an, am, al, ak, aj, ai, ah,
283283
ag, af, ae, ad, ac, bz, by, bx, bw, bv, bu, bt, bs, br, bq, bp, bo, bn, bm,
284284
bl, bk, bj, bi, bh, bg, bf, be, bd, bc
285285
286-
say join ", ", "r2".."t3"
287-
r2, r3, s2, s3, t2, t3
286+
say join ", ", "r2".."t3";
287+
# OUTPUT: «r2, r3, s2, s3, t2, t3␤»
288288
289289
To achieve simpler behaviour, similar to the Perl 5 example above, use a sequence operator that calls C<.succ> method on the
290290
starting string:
291291
292-
say join ", ", ("az", *.succ ... "bc")
293-
az, ba, bb, bc
292+
say join ", ", ("az", *.succ ... "bc");
293+
# OUTPUT: «az, ba, bb, bc␤»
294294
295295
=head2 Topicalizing Operators
296296
@@ -342,8 +342,8 @@ Adverbs do have a precedence that may not follow the order of operators that is
342342
343343
The loose precedence of C<..> can lead to some errors. It is usually best to parenthesize ranges when you want to operate on the entire range.
344344
345-
1..3.say # says "3" (and warns about useless "..")
346-
(1..3).say # says "1..3"
345+
1..3.say; # says "3" (and warns about useless "..")
346+
(1..3).say; # says "1..3"
347347
348348
=head2 Loose boolean operators
349349

0 commit comments

Comments
 (0)