@@ -214,7 +214,7 @@ All the same rules for semicolons and newlines apply, consistently
214
214
215
215
if 0 { say "no" }
216
216
elsif False { say "NO" }
217
- else { say "yes" } ; # -> says "yes"
217
+ else { say "yes" } ; # says "yes"
218
218
219
219
The whole thing either L < slips|/type/Slip > us an empty list (if no blocks
220
220
were run) or returns the value produced by the block that did run:
@@ -242,20 +242,20 @@ the sense of a conditional statement. You cannot use C<else> or C<elsif>
242
242
with C < unless > because that ends up getting confusing. Other than those
243
243
two differences C < unless > works the same as L < if > :
244
244
245
- unless 1 { "1 is false".say } ; #-> does not say anything, since 1 is true
246
- unless 1 "1 is false".say ; #-> syntax error, missing block
247
- unless 0 { "0 is false".say } ; #-> says "0 is false"
245
+ unless 1 { "1 is false".say } ; # does not say anything, since 1 is true
246
+ unless 1 "1 is false".say ; # syntax error, missing block
247
+ unless 0 { "0 is false".say } ; # says "0 is false"
248
248
249
- unless 42.say and 1 { 43.say } ; #-> says "42" but does not say "43"
250
- 43.say unless 42.say and 0; #-> says "42" and then says "43"
251
- 43.say unless 42.say and 1; #-> says "42" but does not say "43"
249
+ unless 42.say and 1 { 43.say } ; # says "42" but does not say "43"
250
+ 43.say unless 42.say and 0; # says "42" and then says "43"
251
+ 43.say unless 42.say and 1; # says "42" but does not say "43"
252
252
253
- $_ = 1; unless 0 { $_.say } ; # -> says "1"
254
- $_ = 1; unless 0 -> $_ { $_.say } ; # -> says "0"
255
- $_ = 1; unless False -> $a { $a.say } ; # -> says "False"
253
+ $_ = 1; unless 0 { $_.say } ; # says "1"
254
+ $_ = 1; unless 0 -> $_ { $_.say } ; # says "0"
255
+ $_ = 1; unless False -> $a { $a.say } ; # says "False"
256
256
257
- my $c = 0; say (1, (unless 0 { $c += 42; 2; }), 3, $c); #-> says "1 2 3 42"
258
- my $c = 0; say (1, (unless 1 { $c += 42; 2; }), 3, $c); #-> says "1 3 0"
257
+ my $c = 0; say (1, (unless 0 { $c += 42; 2; }), 3, $c); # says "( 1 2 3 42) "
258
+ my $c = 0; say (1, (unless 1 { $c += 42; 2; }), 3, $c); # says "( 1 3 0) "
259
259
260
260
= head3 X < with, orwith, without|control flow,with orwith without >
261
261
0 commit comments