Skip to content

Commit

Permalink
Merge pull request #3344 from edmangimelli/patch-1
Browse files Browse the repository at this point in the history
Fix description of Ruby case-when in rb-nutshell
  • Loading branch information
JJ committed Apr 19, 2020
2 parents 256d21e + fa01cd9 commit 1ad5e59
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions doc/Language/rb-nutshell.pod6
Expand Up @@ -637,9 +637,10 @@ it does not allow for an C<elsif> or C<else> clause.
=head3 C<case>-C<when>
The Raku C<given>-C<when> construct is like a chain of C<if>-C<elsif>-C<else>
statements or like the C<case>-C<when> construct in Ruby. A big difference is
that Ruby uses the C<==> comparison for each condition, but Raku uses the
more general smartmatch C<~~> operator.
statements, and its direct analog is Ruby's C<case>-C<when> construct.
Just as Ruby uses the C<===> (case equality) operator for each condition in a
C<case>-C<when> expression, Raku, likewise, uses the smartmatch C<~~> operator
with C<given>-C<when>.
It has the
general structure:
Expand Down

0 comments on commit 1ad5e59

Please sign in to comment.