Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Rephrase sentence and add small example
  • Loading branch information
uzluisf committed Oct 7, 2018
1 parent 89bc20d commit 651d20b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions doc/Language/functions.pod6
Expand Up @@ -177,14 +177,15 @@ one to skip commas between named arguments.
=head2 Return values
Any C<Block> or C<Routine> will provide the value of its last expression as a return value
to the caller. If L<return|/language/control#return> or
L<return-rw|/language/control#return-rw> are called their parameter, if any,
to the caller. If either L<return|/language/control#return> or
L<return-rw|/language/control#return-rw> is called, then its parameter, if any,
will become the return value. The default return value is L<Nil|/type/Nil>.
sub a { 42 };
sub b { say a };
b;
# OUTPUT: «42␤»
sub c { };
b; # OUTPUT: «42␤»
say c; # OUTPUT: «Nil␤»
Multiple return values are returned as a list or by creating a
L<Capture|/type/Capture>. Destructuring can be used to untangle multiple return
Expand Down

0 comments on commit 651d20b

Please sign in to comment.