Skip to content

Commit a9fd27e

Browse files
committed
Space after commas
As per #624
1 parent 68b14e2 commit a9fd27e

28 files changed

+196
-196
lines changed

doc/Language/5to6-perlfunc.pod

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1331,7 +1331,7 @@ method I. e. C<sort(@a)> is equivalent to C<@a.sort>.
13311331
13321332
=item splice EXPR
13331333
1334-
Available in Perl 6. Can also be used as a method. C<< splice(@foo, 2,3,
1334+
Available in Perl 6. Can also be used as a method. C<< splice(@foo, 2, 3,
13351335
<M N O P>); >> is equivalent to C<< @foo.splice(2, 3, <M N O P>); >>.
13361336
13371337
=head2 split
@@ -1735,11 +1735,11 @@ a C<List> or C<Array> in a C<Scalar>, simply returning a list may be
17351735
all that is needed:
17361736
17371737
sub listofstuff {
1738-
return 1,2,3;
1738+
return 1, 2, 3;
17391739
}
17401740
my $a = listofstuff();
1741-
print $a; # prints "123"
1742-
print join("<",listofstuff()) # prints "1<2<3"
1741+
print $a; # prints "123"
1742+
print join("<", listofstuff()) # prints "1<2<3"
17431743
17441744
One of the most common use cases is to provide either an array of lines
17451745
or elements, or a prettier string than would be produced by simply
@@ -1751,8 +1751,8 @@ purpose:
17511751
method Str { self.join("<") }
17521752
}
17531753
}
1754-
print prettylist(1,2,3); # prints "1<2<3"
1755-
print join(">", prettylist(3,2,1)); # prints "3>2>1"
1754+
print prettylist(1, 2, 3); # prints "1<2<3"
1755+
print join(">", prettylist(3, 2, 1)); # prints "3>2>1"
17561756
17571757
In the above example, the returned list may be lazy, and the C<.Str> method
17581758
is not called until stringification happens, so no extra work is done

doc/Language/5to6-perlvar.pod

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,10 @@ $^z)>. Ergo:
132132
133133
=begin code
134134
135-
sort { $^a cmp $^z }, 1,5,6,4,2,3;
136-
# 1,2,3,4,5,6
137-
sort { $^g cmp $^a }, 1,5,6,4,2,3;
138-
# 6,5,4,3,2,1
135+
sort { $^a cmp $^z }, 1, 5, 6, 4, 2, 3;
136+
# (1 2 3 4 5 6)
137+
sort { $^g cmp $^a }, 1, 5, 6, 4, 2, 3;
138+
# (6 5 4 3 2 1)
139139
for 1..9 { say $^c, $^a, $^b; last }
140140
# 312
141141

doc/Language/containers.pod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,12 +214,12 @@ Note that, while supported, one should generally avoid directly binding
214214
uncontainerized things into array elements. Doing so may produce
215215
counter-intuitive results when the array is used later.
216216
217-
my @a = (1,2,3);
217+
my @a = (1, 2, 3);
218218
@a[0] := 42; # This is not recommended, use assignment instead.
219219
my $b := 42;
220220
@a[1] := $b; # Nor is this.
221221
@a[2] = $b; # ...but this is fine.
222-
@a[1,2] := 1,2; # This is not allowed and will fail.
222+
@a[1, 2] := 1, 2; # This is not allowed and will fail.
223223
224224
Operations that mix Lists and Arrays generally protect against such
225225
a thing happening accidentally.

doc/Language/control.pod

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ expression. So:
9999
the expression it is contained in is evaluated:
100100
101101
# This says "(..1 ..2 ..3)" not "(..1 ...2 ....3)"
102-
my $f = "."; say do { $f ~= "." } X~ 1,2,3;
102+
my $f = "."; say do { $f ~= "." } X~ 1, 2, 3;
103103
104104
In other words, it follows the same reification rules as everything else.
105105
@@ -350,9 +350,9 @@ assign them to an array:
350350
351351
=begin code
352352
353-
(for 1,2,3 { $_ * 2 }).say; # says "(2 4 6)"
354-
my @a = do for 1,2,3 { $_ * 2 }; @a.say;# says "[2 4 6]"
355-
my @a = (for 1,2,3 { $_ * 2 }); @a.say; # same thing
353+
(for 1, 2, 3 { $_ * 2 }).say; # says "(2 4 6)"
354+
my @a = do for 1, 2, 3 { $_ * 2 }; @a.say; # says "[2 4 6]"
355+
my @a = (for 1, 2, 3 { $_ * 2 }); @a.say; # same thing
356356
357357
=end code
358358

doc/Language/faq.pod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -679,7 +679,7 @@ Examples:
679679
# A perl program which works under both perl5 (with perl -Mbigint)
680680
# and perl6
681681
682-
my ($prev, $current) = (1,0);
682+
my ($prev, $current) = (1, 0);
683683
684684
for (0..100_000) {
685685
($prev, $current) = ($current, $prev + $current);

doc/Language/functions.pod

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -167,16 +167,16 @@ can use it on methods as well. The candidates are all the multi methods of the
167167
object:
168168
169169
class Congrats {
170-
multi method congratulate($reason,$name) {
170+
multi method congratulate($reason, $name) {
171171
say "Hooray for your $reason, $name";
172172
}
173173
}
174174
175175
role BirthdayCongrats {
176-
multi method congratulate('birthday',$name) {
176+
multi method congratulate('birthday', $name) {
177177
say "Happy birthday, $name";
178178
}
179-
multi method congratulate('birthday',$name,$age) {
179+
multi method congratulate('birthday', $name, $age) {
180180
say "Happy {$age}th birthday, $name";
181181
}
182182
}
@@ -230,8 +230,8 @@ C<{*}> always dispatches to candidates with the parameters it's called
230230
with. Parameter defaults and type coercions will work but are not be passed on.
231231
232232
proto mistake-proto(Str() $str, Int $number = 42) {*}
233-
multi mistake-proto($str,$number) { say $str.WHAT }
234-
mistake-proto(7,42); #-> (Int) -- coercions not passed on
233+
multi mistake-proto($str, $number) { say $str.WHAT }
234+
mistake-proto(7, 42); #-> (Int) -- coercions not passed on
235235
mistake-proto('test'); #!> fails -- defaults not passed on
236236
237237
=comment only
@@ -271,29 +271,29 @@ This can be achieved by using a slurpy with a C<+> or C<+@> instead of C<**>:
271271
This results in the following behavior, which is known as the "single
272272
argument rule" and is important to understand when invoking slurpy functions:
273273
274-
grab(1,2); # grab 1 grab 2
275-
grab((1,2)); # grab 1 grab 2
276-
grab($(1,2)); # grab 1 2
277-
grab((1,2),3); # grab 1 2 grab 3
274+
grab(1, 2); # grab 1 grab 2
275+
grab((1, 2)); # grab 1 grab 2
276+
grab($(1, 2)); # grab 1 2
277+
grab((1, 2), 3); # grab 1 2 grab 3
278278
279279
This also makes user-requested flattening feel consistent whether there is
280280
one sublist, or many:
281281
282-
grab(flat (1,2),(3,4)); # grab 1 grab 2 grab 3 grab 4
283-
grab(flat $(1,2),$(3,4)); # grab 1 2 grab 3 4
284-
grab(flat (1,2)); # grab 1 grab 2
285-
grab(flat $(1,2)); # grab 1 2
282+
grab(flat (1, 2), (3, 4)); # grab 1 grab 2 grab 3 grab 4
283+
grab(flat $(1, 2), $(3, 4)); # grab 1 2 grab 3 4
284+
grab(flat (1, 2)); # grab 1 grab 2
285+
grab(flat $(1, 2)); # grab 1 2
286286
287287
It is worth noting that mixing binding and sigilless variables
288288
in these cases requires a bit of finesse, because there is no Scalar
289289
intermediary used during binding.
290290
291-
my $a = (1,2); # Normal assignment, equivalent to $(1,2)
292-
grab ($a); # grab 1 2
293-
my $b := (1,2); # Binding, $b links directly to a bare (1,2)
294-
grab ($b); # grab 1 grab 2
295-
my \c = (1,2); # Sigilless variables always bind, even with '='
296-
grab (c); # grab 1 grab 2
291+
my $a = (1, 2); # Normal assignment, equivalent to $(1, 2)
292+
grab ($a); # grab 1 2
293+
my $b := (1, 2); # Binding, $b links directly to a bare (1, 2)
294+
grab ($b); # grab 1 grab 2
295+
my \c = (1, 2); # Sigilless variables always bind, even with '='
296+
grab (c); # grab 1 grab 2
297297
298298
=head1 Functions are First-Class Objects
299299

doc/Language/glossary.pod

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,8 @@ do that on a list. This is separate from the type of elements in the array:
147147
if they are containers, then they are also mutable, but they don't have to
148148
be. Arrays are typically recognizable by the L<#@> L<sigil|#Sigil>.
149149
150-
my @array = 1,2,3;
151-
say @a; # [1 2 3]
150+
my @array = 1, 2, 3;
151+
say @array; # [1 2 3]
152152
153153
=head1 Arity
154154
@@ -191,7 +191,7 @@ value of the junction. The result of these calls is assembled in a new
191191
junction of the same type as the original junction.
192192
193193
sub f($x) { 2 * $x };
194-
say f(1|2|3) == 4; # any(False,True,False)
194+
say f(1|2|3) == 4; # any(False, True, False)
195195
196196
Here C<f()> is a sub with one parameter, and since it has no explicit type,
197197
it is implicitly typed as C<Any>. The C<Junction> argument causes the
@@ -249,8 +249,8 @@ See the L<Wikipedia entry|https://en.wikipedia.org/wiki/Class_%28computer_progra
249249
A colon pair is a shorthand syntax used to create or visually present
250250
a Pair object. The two most common forms are:
251251
252-
:a(4) # Same as "a" => 4, same as Pair.new("a",4)
253-
:a<4> # Same as "a" => "4", same as Pair.new("a","4")
252+
:a(4) # Same as "a" => 4, same as Pair.new("a", 4)
253+
:a<4> # Same as "a" => "4", same as Pair.new("a", "4")
254254
255255
This is also known as the adverbial pair form. Note: when the part after
256256
the colon and before the brackets is not a legal identifier, other
@@ -294,7 +294,7 @@ Note that you can also differentiate candidates in a
294294
L<multi-dispatch|#Multi-Dispatch> by using a different constraint:
295295
296296
multi sub abbreviate(Str $thing where { .chars > 10 }) {
297-
"$thing.substr(0,7)..."
297+
"$thing.substr(0, 7)..."
298298
}
299299
multi sub abbreviate(Str $thing) { $thing } # no constraint
300300
@@ -623,7 +623,7 @@ in Perl 6. It is what C<self> refers to in a method.
623623
624624
=head1 JIT
625625
626-
L<Just-in-time compilation|https://en.wikipedia.org/wiki/Just-in-time_compilation>,a technique for improving the performance of virtual machines.
626+
L<Just-in-time compilation|https://en.wikipedia.org/wiki/Just-in-time_compilation>, a technique for improving the performance of virtual machines.
627627
628628
=head1 Junction
629629

0 commit comments

Comments
 (0)