Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- martin@thetis ~/.workspace/p6/Creator
- % cat CreatorOfHuman.pm6
- use v6;
- use Human;
- role CreatorOfHuman {
- method create_human(Str $name) {
- return Human.new(:$name);
- }
- }
- martin@thetis ~/.workspace/p6/Creator
- % cat God.pm6
- use v6;
- use CreatorOfHuman;
- class God {
- has $.might = 1;
- }
- martin@thetis ~/.workspace/p6/Creator
- % cat Human.pm6
- use v6;
- use CreatorOfHuman;
- class Human is CreatorOfHuman {
- has $.name = "Jane Doe";
- }
- martin@thetis ~/.workspace/p6/Creator
- % perl6 -I. -e 'use God; my $god = God.new'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement