Created
May 21, 2023 10:38
-
-
Save gfldex/88209367b5f1e9ce063935e9a6b2d481 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sub foo($a) { | |
multi sub when(Int:D $a) { say $a.WHAT; } | |
multi sub when(Str:D $s) { say $s.WHAT; } | |
multi sub when(|) { say ‘default’ } | |
when($a); | |
} | |
foo ('Answer', 42, Nil).all; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment