Skip to content

Commit ed89baf

Browse files
committed
Improve the example
To reflect what is indicated by @lizmat here https://stackoverflow.com/questions/41531393/can-i-use-a-standalone-signature-as-a-signature-in-perl-6#comment84619436_41543023 and also reflect the intent of putting signatures into variables, as said in #1748 (by myself, but still). Also modifies the example changed in #1777, so thanks to @jimav for drawing this to our attention.
1 parent 881d17d commit ed89baf

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

doc/Type/Signature.pod6

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ Smart matching signatures against a List is supported.
5858
my $sig = :(Int $i, Str $s);
5959
say (10, 'answer') ~~ $sig;
6060
# OUTPUT: «True␤»
61+
my $ßub = sub ( Str $ß, Int $þ ) { return $ß xx $þ };
62+
say $ßub.signature ~~ :( Str, Int );
63+
# OUTPUT: «True␤»
6164
given $sig {
6265
when :(Str, Int) { say 'mismatch' }
6366
when :($, $) { say 'match' }

0 commit comments

Comments
 (0)