Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
doc Mu.return and Mu.return-rw
  • Loading branch information
gfldex committed Jul 8, 2016
1 parent 845d9dd commit 2196187
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions doc/Type/Mu.pod6
Expand Up @@ -288,6 +288,24 @@ are marked as C<is export>.
See L<Exporting and Selective Importing Modules|/language/modules#Exporting_and_Selective_Importing>
for more details.
=head2 method return
method return();
The method C<return> will stop execution of a subroutine or method, run all
relevant L<phasers|/language/phasers#Block_Phasers> and provide invocant as a
return value to the caller. If a return
L<type constraint|/type/Signature#Constraining_Return_Types> is provided it will be
checked unless the return value is C<Nil>. A control exception is raised and
can be caught with L<CONTROL|/language/phasers#CONTROL>.
sub f { (1|2|3).return };
dd f(); # OUTPUT«any(1, 2, 3)␤»
=head2 method return-rw
Same as method L<C<return>|/type/Mu#return> but provides the invocant as a
writeable container to the invocant.
=head2 method take
Expand Down

0 comments on commit 2196187

Please sign in to comment.