-
-
Save leedo/7603df457e182976295e 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
use v6; | |
class A { | |
use B; | |
has B $.b; | |
method run { | |
$.b.dispatch(self); | |
} | |
} |
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
use v6; | |
class A { ... } | |
class B { | |
method dispatch (A $a) { | |
say $a; | |
} | |
} |
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
leedo@zaphod:~/src$ perl6 -I. test.pl | |
===SORRY!=== Error while compiling /home/leedo/src/B.pm | |
The following packages were stubbed but not defined: | |
A | |
at /home/leedo/src/B.pm:9 | |
------> <BOL>⏏<EOL> | |
expecting any of: | |
statement end | |
from :4 | |
from test.pl:5 |
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
#!/usr/bin/env perl6 | |
use v6; | |
use A; | |
my $a = A.new; | |
$a.run; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment