Skip to content

Commit ee9f0b2

Browse files
committed
Added samewith
Based this on Brad Gilbert's example here: http://stackoverflow.com/a/37064186/215487. I recommend further elaboration by someone who knows more about it than I do.
1 parent f33f8af commit ee9f0b2

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

doc/Language/control.pod

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -774,6 +774,24 @@ conditional again.
774774
775775
=comment TODO
776776
777+
=head1 X<samewith|control flow>
778+
779+
The C<samewith> allows one to call a multisub of the same name as the current sub.
780+
781+
=begin code
782+
783+
multi indent-say ( 'test' )
784+
{
785+
samewith 'ABCD';
786+
}
787+
788+
multi indent-say ( Str $string )
789+
{
790+
say "\t$string";
791+
}
792+
793+
=end code
794+
777795
=end pod
778796

779797
# vim: expandtab shiftwidth=4 ft=perl6

0 commit comments

Comments
 (0)