Skip to content

Commit 2c674a9

Browse files
committed
Correct minor typographical issues in traps.pod
1 parent 37c4b74 commit 2c674a9

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

lib/Language/traps.pod

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
77
When learning a programming language, possibly with the background of being
88
familiar with another programming language, there are always some things that
9-
can surprise you, and might cost valuable time in debugging and discovery.
9+
can surprise you and might cost valuable time in debugging and discovery.
1010
1111
This document aims to show common misconceptions.
1212
@@ -49,7 +49,7 @@ The syntax C<has $.x> is short for something like
4949
C<has $!x; method x() { $!x }>, so the actual attribute is called C<$!x>, and
5050
a read-only accessor method is automatically generated.
5151
52-
So the correct way to write method double is
52+
Thus the correct way to write method C<double> is
5353
5454
method double {
5555
$!x *= 2;
@@ -75,7 +75,7 @@ initializing all attributes yourself. For example
7575
7676
say A.new(x => 42).x; # Any
7777
78-
...leaves C<$!x> uninitialized, because the custom C<BUILD> doesn't initialize
78+
leaves C<$!x> uninitialized, because the custom C<BUILD> doesn't initialize
7979
it.
8080
8181
One possible remedy is to explicitly initialize the attribute in C<BUILD>:
@@ -85,7 +85,7 @@ One possible remedy is to explicitly initialize the attribute in C<BUILD>:
8585
$!x := $x;
8686
}
8787
88-
...which can be shortened to:
88+
which can be shortened to:
8989
9090
submethod BUILD(:$!x) {
9191
$!y = 18;
@@ -127,7 +127,7 @@ Ways to match whitespace:
127127
=item C<' '> (a blank in quotes) to match a single blank
128128
=item C<\t>, C<\n> for specific whitespace (tab, newline)
129129
=item C<\h>, C<\v> for horizontal, vertical whitespace
130-
=item C<<.ws>>, A built-in rule that oftentimes does what you actually want to do
130+
=item C<<.ws>>, a built-in rule for whitespace that oftentimes does what you actually want it to do
131131
=item with C<m:s/a b/> or C<m:sigspace/a b/>, the blank in the regexes matches arbitrary whitespace
132132
133133
=head1 Captures
@@ -143,7 +143,7 @@ value when that C<Capture> is later used. For example:
143143
Here the C<Capture> contained the B<container> pointed to by C<$a> and the
144144
B<value> of the result of the expression C<++$a>. Since the C<Capture> must
145145
be reified before C<&say> can use it, the C<++$a> may happen before
146-
C<&say> looks inside the container in C<$a>, and so it may already be
146+
C<&say> looks inside the container in C<$a> and so it may already be
147147
incremented.
148148
149149
Instead, use an expression that produces a value when you want a value.

0 commit comments

Comments
 (0)