Skip to content

Commit 238ac7d

Browse files
committed
Mostly minor fixes, a slightly more substantial fix in Bag.pod
1 parent aa84e0b commit 238ac7d

File tree

9 files changed

+45
-44
lines changed

9 files changed

+45
-44
lines changed

doc/Type/AST.pod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
class AST { }
88
99
An C<AST> or I<Abstract Syntax Tree> is a partially processed representation
10-
of a program. ASTs are return values of the C<quasi> quoting construct,
10+
of a program. ASTs are return values of the C<quasi> quoting construct,
1111
and are typically used within macros to generate code that is inserted
1212
in the calling location of the macro.
1313
14-
There is no API defined for ASTs yet. Hopefully that will emerge as
14+
There is no API defined for ASTs yet. Hopefully that will emerge as
1515
part of the work on macros.
1616
1717
=end pod

doc/Type/Array.pod

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Usage:
2323
pop ARRAY
2424
ARRAY.pop
2525
26-
Removes and returns the last item from the array. Fails for an empty array.
26+
Removes and returns the last item from the array. Fails for an empty array.
2727
2828
Example:
2929
@@ -58,7 +58,7 @@ Example:
5858
@foo.push: 'd';
5959
say @foo; # a b c d
6060
61-
Note that C<push> does not attempt to flatten its argument list. If you pass
61+
Note that C<push> does not attempt to flatten its argument list. If you pass
6262
an array or list as the thing to push, it becomes one additional element:
6363
6464
my @a = <a b c>;
@@ -92,10 +92,10 @@ Usage:
9292
ARRAY.append(LIST)
9393
append ARRAY, LIST
9494
95-
Appends the argument list to the array passed as first argument. This modifies
96-
the array in-place. Returns the modified array.
95+
Appends the argument list to the array passed as the first argument. This
96+
modifies the array in-place. Returns the modified array.
9797
98-
The difference to method C<push> is that with an array or list argument,
98+
The difference from method C<push> is that with an array or list argument,
9999
C<append> appends several elements (one for each array or list element),
100100
whereas C<push> appends just one element.
101101
@@ -119,14 +119,14 @@ Usage:
119119
shift ARRAY
120120
ARRAY.shift
121121
122-
Removes and returns the first item from the array. Fails for an empty arrays.
122+
Removes and returns the first item from the array. Fails for an empty arrays.
123123
124124
Example:
125125
126126
my @foo = <a b>;
127-
say @foo.shift; # a
128-
say @foo.shift; # b
129-
say @foo.shift; # Element shifted from empty list
127+
say @foo.shift; # a
128+
say @foo.shift; # b
129+
say @foo.shift; # Element shifted from empty list
130130
131131
=head2 routine unshift
132132
@@ -191,14 +191,14 @@ Usage:
191191
ARRAY.splice(START, ELEMS?, REPLACEMENT?)
192192
193193
Deletes C<$elems> elements starting from index C<$start> from the C<Array>,
194-
returns them and replaces them by C<@replacement>. If C<$elems> is omitted,
194+
returns them and replaces them by C<@replacement>. If C<$elems> is omitted,
195195
all the elements starting from index C<$start> are deleted.
196196
197197
Example:
198198
199199
my @foo = <a b c d e f g>;
200-
say @foo.splice(2, 3, <M N O P>); # c d e
201-
say @foo; # a b M N O P f g
200+
say @foo.splice(2, 3, <M N O P>); # c d e
201+
say @foo; # a b M N O P f g
202202
203203
=head2 method shape
204204
@@ -215,8 +215,8 @@ Returns the shape of the array as a list.
215215
Example:
216216
217217
my @foo[2;3] = ( < 1 2 3 >, < 4 5 6 > ); # Array with fixed dimensions
218-
say @foo.shape; # (2 3)
219-
my @bar = ( < 1 2 3 >, < 4 5 6 > ); # Normal array (of arrays)
220-
say @bar.shape; # (*)
218+
say @foo.shape; # (2 3)
219+
my @bar = ( < 1 2 3 >, < 4 5 6 > ); # Normal array (of arrays)
220+
say @bar.shape; # (*)
221221
222222
=end pod

doc/Type/Attribute.pod

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Usage:
4242
4343
ATTRIBUTE.name
4444
45-
Returns the name of the attribute. Note that this is always the private name,
45+
Returns the name of the attribute. Note that this is always the private name,
4646
so if an attribute is declared as C<has $.a>, the name returned is C<$!a>.
4747
4848
=head2 method package
@@ -107,7 +107,7 @@ Usage:
107107
Returns the value stored in this attribute of object C<$instance>.
108108
109109
Note that this method violates encapsulation of the object, and should be
110-
used with care. Here be dragons.
110+
used with care. Here be dragons.
111111
112112
=head2 method set_value
113113
@@ -122,13 +122,13 @@ Usage:
122122
Binds the value C<new_val> to this attribute of object C<$instance>.
123123
124124
Note that this method violates encapsulation of the object, and should be
125-
used with care. Here be dragons.
125+
used with care. Here be dragons.
126126
127127
=head2 trait is required
128128
129129
multi sub trait_mod:<is> (Attribute $attr, :$required!)
130130
131-
Marks an attribute as being required. If a value is not provided
131+
Marks an attribute as being required. If a value is not provided
132132
during object construction, an exception is thrown.
133133
134134
class Foo {
@@ -149,7 +149,7 @@ constructors written using L<bless>.
149149
multi sub trait_mod:<is> (Attribute:D $attr, :$rw!)
150150
151151
Marks an attribute as read/write as opposed to the default
152-
C<readonly>. The default accessor for the attribute will return a
152+
C<readonly>. The default accessor for the attribute will return a
153153
writable value.
154154
155155
class Foo {

doc/Type/Backtrace.pod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
A backtrace shows the dynamic call stack, usually leading up to a point
1010
where an exception was thrown.
1111
12-
It is a List of L<Backtrace::Frame> objects. Its default stringification
12+
It is a List of L<Backtrace::Frame> objects. Its default stringification
1313
excludes backtrace frames that are deemed unnecessary or confusing, for
1414
example routines like C<&die> are hidden by default.
1515

doc/Type/Bag.pod

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@
88
99
A C<Bag> is an immutable bag/multiset, meaning a collection of distinct elements
1010
in no particular order that each have an integer weight assigned to them
11-
signifying how many copies of that element are considered "in the bag". (For
11+
signifying how many copies of that element are considered "in the bag". (For
1212
I<mutable> bags, see L<BagHash> instead.)
1313
1414
C<Bag>s are often used for performing weighted random selections - see
1515
L<.pick|method pick> and L<.roll|method roll>.
1616
17-
Objects/values of any type are allowed as bag elements. Within a C<Bag>, items
17+
Objects/values of any type are allowed as bag elements. Within a C<Bag>, items
1818
that would compare positively with the L<===> operator are considered the same
19-
element, with the number of how many there were as its weight. But of course
19+
element, with the number of how many there are as its weight. But of course
2020
you can also easily get back the expanded list of items (without the order):
2121
2222
=begin code
@@ -30,8 +30,9 @@ say $breakfast.kxxv.sort; # bacon eggs spam spam spam spam
3030
=end code
3131
3232
C<Bag>s can be treated as object hashes using the C<{ }> postcircumfix operator,
33-
which returns the corresponding integer weight for keys that are elements of the
34-
bag, and C<0> for keys that aren't:
33+
or the C< < > > operator for literal string keys, which returns the
34+
corresponding integer weight for keys that are elements of the bag, and C<0> for
35+
keys that aren't:
3536
3637
say $breakfast<bacon>; # 1
3738
say $breakfast<spam>; # 4
@@ -40,7 +41,7 @@ bag, and C<0> for keys that aren't:
4041
=head1 Creating C<Bag> objects
4142
4243
C<Bag>s can be composed using the L<bag|#sub bag> subroutine (or C<Bag.new>, for
43-
which it is a shorthand). Any positional parameters, regardless of their type,
44+
which it is a shorthand). Any positional parameters, regardless of their type,
4445
become elements of the bag:
4546
4647
my $n = bag "a" => 0, "b" => 1, "c" => 2, "c" => 2;
@@ -49,8 +50,8 @@ become elements of the bag:
4950
say $n.values.perl; # (1, 1, 1, 1).list
5051
5152
Alternatively, the C<.Bag> coercer (or its functional form, C<Bag()>) can be
52-
called on an existing object to coerce it to a C<Bag>. Its semantics depend on
53-
the type and contents of the object. In general it evaluates the object in list
53+
called on an existing object to coerce it to a C<Bag>. Its semantics depend on
54+
the type and contents of the object. In general it evaluates the object in list
5455
context and creates a bag with the resulting items as elements, although for
5556
Hash-like objects or Pair items, only the keys become elements of the bag, and
5657
the (cumulative) values become the associated integer weights:
@@ -62,7 +63,7 @@ the (cumulative) values become the associated integer weights:
6263
6364
Furthermore, you can get a C<Bag> by using bag operators (see next section) on
6465
objects of other types such as L<List>, which will internally call C<.Bag>
65-
on them before performing the operation. Be aware of the tight precedence of
66+
on them before performing the operation. Be aware of the tight precedence of
6667
those operators though, which may require you to use parens around arguments:
6768
6869
say (1..5) (+) 4; # bag(1, 2, 3, 4(2), 5)
@@ -71,7 +72,7 @@ those operators though, which may require you to use parens around arguments:
7172
7273
Perl 6 provides common set and bag operators, which can take C<Bag>s (or any
7374
other collections) as input, and return result as C<Bool>, C<Set> or C<Bag>
74-
values. For example:
75+
values. For example:
7576
7677
=begin code
7778
my ($a, $b) = bag(2, 2, 4), bag(2, 3, 3, 4);

doc/Type/BagHash.pod

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ elements in no particular order that each have an integer weight assigned to
1111
them signifying how many copies of that element are considered "in the bag".
1212
(For I<immutable> bags, see L<Bag> instead.)
1313
14-
Objects/values of any type are allowed as bag elements. Within a C<BagHash>,
14+
Objects/values of any type are allowed as bag elements. Within a C<BagHash>,
1515
items that would compare positively with the L<===> operator are considered the
16-
same element, with the number of how many there were as its weight. But of
16+
same element, with the number of how many there were as its weight. But of
1717
course you can also easily get back the expanded list of items (without the
1818
order):
1919
@@ -29,8 +29,8 @@ say $breakfast.kxxv.sort; # bacon eggs spam spam spam spam
2929
3030
C<BagHash>es can be treated as object hashes using the C<{ }> postcircumfix
3131
operator, which returns the corresponding integer weight for keys that are
32-
elements of the bag, and C<0> for keys that aren't. It can also be used to
33-
modify weights; Setting a weight to C<0> automatically removes that element from
32+
elements of the bag, and C<0> for keys that aren't. It can also be used to
33+
modify weights; setting a weight to C<0> automatically removes that element from
3434
the bag, and setting a weight to a positive number adds that element if it
3535
didn't already exist:
3636
@@ -46,7 +46,7 @@ say $breakfast.kxxv.sort; # eggs sausage sausage spam spam spam spam
4646
4747
=head1 Creating C<BagHash> objects
4848
49-
C<BagHash>es can be composed using C<BagHash.new>. Any positional parameters,
49+
C<BagHash>es can be composed using C<BagHash.new>. Any positional parameters,
5050
regardless of their type, become elements of the bag:
5151
5252
my $n = BagHash.new: "a" => 0, "b" => 1, "c" => 2, "c" => 2;
@@ -55,8 +55,8 @@ regardless of their type, become elements of the bag:
5555
say $n.values.perl; # (1, 1, 1, 1).list
5656
5757
Alternatively, the C<.BagHash> coercer (or its functional form, C<BagHash()>)
58-
can be called on an existing object to coerce it to a C<BagHash>. Its semantics
59-
depend on the type and contents of the object. In general it evaluates the
58+
can be called on an existing object to coerce it to a C<BagHash>. Its semantics
59+
depend on the type and contents of the object. In general it evaluates the
6060
object in list context and creates a bag with the resulting items as elements,
6161
although for Hash-like objects or Pair items, only the keys become elements of
6262
the bag, and the (cumulative) values become the associated integer weights:

doc/Type/Baggy.pod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
77
class Baggy does QuantHash { }
88
9-
A role for collections of weighted objects. See L<Bag>, L<BagHash>, and
9+
A role for collections of weighted objects. See L<Bag>, L<BagHash>, and
1010
L<Mixy>.
1111
1212
=head1 Methods

doc/Type/Blob.pod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Usage:
2323
2424
Creates a C<Blob> from a list of integers.
2525
26-
=head2 method Bool
26+
=head2 method Bool
2727
2828
Defined as:
2929
@@ -103,7 +103,7 @@ Extracts features from the blob according to the template string, and
103103
returns them as a list.
104104
105105
The template string consists of zero or more units that begin with an ASCII
106-
letter, and are optionally followed by a quantifier. The quantifier can be
106+
letter, and are optionally followed by a quantifier. The quantifier can be
107107
C<*> (which typically stands for "use up the rest of the Blob here"), or a
108108
positive integer (without a C<+>).
109109

doc/Type/Block.pod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
77
class Block is Code { }
88
9-
A C<Block> is a code object meant for small-scale code reuse. A block is
9+
A C<Block> is a code object meant for small-scale code reuse. A block is
1010
created syntactically by a list of statements enclosed in curly braces.
1111
1212
Without an explicit signature or placeholder arguments, a block has C<$_>

0 commit comments

Comments
 (0)