Skip to content

Commit 9c5ccd0

Browse files
authored
Merge pull request #2300 from uzluisf/master
Remove period from headings and subheadings and other minor fixes
2 parents 6bc8ce7 + b049dc1 commit 9c5ccd0

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

doc/Language/traps.pod6

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ behaviour similar to a constant, but allowing the value to get updated:
4545
unit module Something::Or::Other;
4646
my $config-file := "config.txt".IO.slurp;
4747
48-
=head2 Assigning to C<Nil> produces a different value, usually C<Any>.
48+
=head2 Assigning to C<Nil> produces a different value, usually C<Any>
4949
5050
Actually, assigning to C<Nil>
5151
L<reverts the variable to its default value|https://docs.perl6.org/type/Nil>. So:
@@ -101,7 +101,7 @@ routine is called, but the counter is not increasing:
101101
When it comes to state variables, the block in which the vars are
102102
declared gets cloned —and vars get initialized anew— whenever that
103103
block's block is re-entered. This lets constructs like the one below
104-
behave appropriately: the state variable inside the loop gets
104+
behave appropriately; the state variable inside the loop gets
105105
initialized anew each time the sub is called:
106106
107107
=begin code
@@ -170,7 +170,7 @@ You can use the second form if you effectively want to declare an empty
170170
block:
171171
172172
my &does-nothing = {;};
173-
say does-nothing(33);# OUTPUT: «Nil␤»
173+
say does-nothing(33); # OUTPUT: «Nil␤»
174174
175175
176176
=head1 Objects
@@ -199,8 +199,8 @@ say Point.new(x => 1, y => -2).double.x
199199
# OUTPUT: «Cannot assign to an immutable value␤»
200200
=end code
201201
202-
in the first line marked with C<# WRONG>, because C<$.x>, short for C<$(
203-
self.x )>, is a call to a read-only accessor.
202+
the first line inside the method C<double> is marked with C<# WRONG> because C<$.x>,
203+
short for C<$( self.x )>, is a call to a read-only accessor.
204204
205205
The syntax C<has $.x> is short for something like C<has $!x; method x() {
206206
$!x }>, so the actual attribute is called C<$!x>, and a read-only accessor
@@ -346,11 +346,11 @@ my @a = [[<foo bar ber>],];
346346
347347
=head3 Less than vs. Word quoting/Associative indexing
348348
=for code :skip-test
349-
# WRONG; trying to index 3 associatively
349+
# WRONG; trying to index 3 associatively:
350350
say 3<5>4
351351
352352
=begin code
353-
# RIGHT; prefer some extra whitespace around infix operators
353+
# RIGHT; prefer some extra whitespace around infix operators:
354354
say 3 < 5 > 4
355355
=end code
356356
@@ -495,11 +495,11 @@ say @colors.roll(3); # red green red (can repeat)
495495
496496
You want to check whether a number is divisible by any of a set of numbers:
497497
498-
say 42 %% <11 33 88 55 111 20325>; # OUTPUT: «True␤
498+
say 42 %% <11 33 88 55 111 20325>; # OUTPUT: «True␤»
499499
500500
What? There's no single number 42 should be divisible by. However, that list has 6 elements, and 42 is divisible by 6. That's why the output is true. In this case, you should turn the C<List> into a L<Junction>:
501501
502-
say 42 %% <11 33 88 55 111 20325>.any;# OUTPUT: «any(False, False, False, False, False, False)␤»
502+
say 42 %% <11 33 88 55 111 20325>.any; # OUTPUT: «any(False, False, False, False, False, False)␤»
503503
504504
which will clearly reveal the falsehood of the divisiveness of all the numbers in the list, which will be numified separately.
505505
@@ -629,7 +629,7 @@ There are methods that L<Str|/type/Str> inherits from L<Any|/type/Any> that work
629629
say "cba".sort; # OUTPUT: «(cba)␤»
630630
say "cba".comb.sort.join; # OUTPUT: «abc␤»
631631
632-
=head2 C<.chars> Gets the Number of Graphemes, not Codepoints
632+
=head2 C<.chars> gets the number of graphemes, not Codepoints
633633
634634
In Perl 6, L«C<.chars>|chars» returns the number of graphemes, or user visible characters.
635635
These graphemes could be made up of a letter plus an accent for example.
@@ -739,7 +739,7 @@ about L<Pair|/type/Pair>.
739739
740740
=head1 Sets, bags and mixes
741741
742-
=head2 Sets, bags and mixes do not have a fixed order.
742+
=head2 Sets, bags and mixes do not have a fixed order
743743
744744
When iterating over this kind of objects, an order is not defined.
745745
@@ -1492,7 +1492,7 @@ character 'a' comes before the character 'b'. For example:
14921492
=for code
14931493
# In order
14941494
sub f1 { say "$^first $^second"; }
1495-
f1 "Hello", "there"; # OUTPUT: «Hello There␤»
1495+
f1 "Hello", "there"; # OUTPUT: «Hello there␤»
14961496
14971497
=for code
14981498
# Out of order
@@ -1699,7 +1699,7 @@ say foo rand; # OUTPUT: «Type check failed in binding to parameter '<anon>'; ex
16991699
17001700
=head1 Grammars
17011701
1702-
=head2 Using regexes within grammar's actions.
1702+
=head2 Using regexes within grammar's actions
17031703
17041704
=begin code :skip-test
17051705
grammar will-fail {
@@ -1869,7 +1869,7 @@ other operators.
18691869
18701870
=head1 Maps
18711871
1872-
=head2 Beware of nesting C<Map>s in sink context.
1872+
=head2 Beware of nesting C<Map>s in sink context
18731873
18741874
Maps apply an expression to every element of a L<List> and return a L<Seq>:
18751875

0 commit comments

Comments
 (0)