Skip to content

Commit fa0b7f8

Browse files
authored
In language/list: some minor corrections and clarifications (#4685)
* say what parentheses do * typo * add example to a sentence that's hard to parse * space after comma * add comma in sentence Corrected punctuation in the explanation of itemization.
1 parent ec14ecd commit fa0b7f8

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

doc/Language/contexts.rakudoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ $(1,2,3).elems.say; # OUTPUT: «3␤»
241241
say (1,2,3).item[2]; # OUTPUT: «3␤»
242242
say $( key => 'value')<key>; # OUTPUT: «value␤»
243243

244-
Itemization I<containerizes> values in a data structure keeping them, for
244+
Itemization I<containerizes> values in a data structure, keeping them, for
245245
instance, from being flattened into the surrounding list or data structure:
246246

247247
=for code

doc/Language/list.rakudoc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ elegant system for handling them.
1313
=head1 Literal lists
1414

1515
Literal L<C<List>|/type/List>s are created with commas and semicolons, B<not>
16-
with parentheses, so:
16+
with parentheses (which only group things), so:
1717

1818
1, 2; # This is two-element list
1919
our $list = (1, 2); # This is also a List, in parentheses
@@ -96,7 +96,7 @@ instead.
9696
One of the ways C<@>-sigiled variables act like lists is by always supporting
9797
L<positional subscripting|/language/subscripts>. Anything bound to an
9898
C<@>-sigiled value must support the L<C<Positional>|/type/Positional> role which
99-
guarantees that this is going to fail:
99+
guarantees that the following is going to fail:
100100

101101
my @a := 1; # Type check failed in binding; expected Positional but got Int
102102

@@ -166,7 +166,7 @@ would expect>.
166166

167167
This rule is equivalent to saying that arguments to iterators will not
168168
flatten, will not de-containerize, and will behave as if a single argument
169-
has been handled to them, whatever the shape that argument has.
169+
has been handed to them, whatever the shape that argument has.
170170

171171
=for code
172172
my @a = 1,2; .say for @a, |@a; # OUTPUT: «[1 2]␤1␤2␤»
@@ -175,7 +175,7 @@ my @a = 1,2; .say for $[@a, |@a ]; # OUTPUT: «[[1 2] 1 2]␤»
175175
In the second case, the single argument is a single element, since we have
176176
itemized the array. There's an exception to the single argument rule
177177
L<mentioned in the Synopsis|https://github.com/Raku/old-design-docs/blob/master/S07-lists.pod#The_single_argument_rule>:
178-
list or arrays with a single element will be flattened:
178+
lists or arrays with a single element will be flattened:
179179

180180
=for code
181181
my @a = 1,2; .say for [[@a ]]; # OUTPUT: «1␤2␤»
@@ -748,12 +748,12 @@ as a courtesy to their users:
748748
=item Use L<C<Slip>|/type/Slip>s when you want to always merge with surrounding lists.
749749
=item Use non-itemized lists when you want to make it easy for the user to flatten.
750750
=item Use itemized lists to protect things the user probably will not want flattened.
751-
=item Use L<C<Array>|/type/Array>s as non-itemized lists of itemized lists, if appropriate.
751+
=item Use L<C<Array>|/type/Array>s as non-itemized lists of itemized lists, if appropriate. (E.g. C<[$(1, 2), $(3, 4)]>.)
752752
=item Use L<C<Array>|/type/Array>s if the user is going to want to mutate the result without copying it first.
753753

754754
The fact that all elements of an array are itemized (in L<C<Scalar>|/type/Scalar>
755755
containers) is more a gentleman's agreement than a universally enforced
756-
rule, and it is less well enforced that typechecks in typed arrays. See
756+
rule, and it is less well enforced than typechecks in typed arrays. See
757757
the section below on binding to Array slots.
758758

759759
=head2 Literal arrays

0 commit comments

Comments
 (0)