Created
November 1, 2015 13:36
-
-
Save peschwa/2d25e44bcabecf1d6ced 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
$ cat Foo.pm | |
module Foo { | |
my $_marshal_proto = my proto _marshal(|c) {*}; | |
$_marshal_proto.add_dispatchee(sub (Int $) { "Int" }); | |
sub get_marshal_proto is export is rw { $_marshal_proto } | |
sub marshal(Any $x) is export { | |
say $_marshal_proto($x) | |
} | |
} | |
$ ./perl6-m -I. -MFoo -e'get_marshal_proto.add_dispatchee(sub (Str $) { "Str" }); marshal("foo")' | |
Str |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Shiip it! 👍 ;-)