Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #239 from baby-gnu/fix/obsolete-implementation-notes
Fix/obsolete implementation notes
  • Loading branch information
jonathanstowe committed Dec 13, 2015
2 parents 917addb + ab5de74 commit 68a913a
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions doc/Language/control.pod
Expand Up @@ -147,19 +147,13 @@ run the block, or it will return the value which the block produces:
my $c = 0; say (1, (if 1 { $c += 42; 2; }), 3, $c); # says "1 2 3 42"
my $d = 0; say (1, (if 0 { $d += 42; 2; }), 3, $d); # says "1 3 0"
Implementation note: Currently, Rakudo will say "1 Nil 3 0" for the last
example because it is not caught up to this part of the design yet.
For the statement modifier it is the same, except you have the value
of the statement instead of a block:
say (1, (42 if True) , 2); # says "1 42 2"
say (1, (42 if False), 2); # says "1 2"
say (1, 42 if False , 2); # says "1 42" because "if False, 2" is true
Implementation note: Currently, Rakudo will say "1 Nil 2" for the second
example because it is not caught up to this part of the design yet.
The C<if> does not change the topic (C<$_>) by default. In order to access
the value which the conditional expression produced, you have to ask
for it more strongly:
Expand Down Expand Up @@ -231,9 +225,6 @@ or the value produced by the block that did run:
(if 0 { $d += 42; "two"; } elsif False { $d += 43; 2; }),
3, $d); # says "1 3 0"
Implementation note: Currently, Rakudo will say "1 Nil 3 0" for the last
example because it is not caught up to this part of the design yet.
It's possible to obtain the value of the previous expression inside an
C<else>, which could be from C<if> or the last C<elsif> if any are
present:
Expand Down Expand Up @@ -265,9 +256,6 @@ two differences C<unless> works the same as L<if>:
my $c = 0; say (1, (unless 0 { $c += 42; 2; }), 3, $c); #-> says "1 2 3 42"
my $c = 0; say (1, (unless 1 { $c += 42; 2; }), 3, $c); #-> says "1 3 0"
Implementation note: Currently, Rakudo will say "1 Nil 3 0" for the last
example because it is not caught up to this part of the design yet.
=head3 X<with, orwith, without|control flow,with orwith without>
The C<with> statement is like C<if> but tests for definedness rather than
Expand Down

0 comments on commit 68a913a

Please sign in to comment.