Skip to content

Instantly share code, notes, and snippets.

@jnthn
Created July 13, 2011 13:16
Show Gist options
  • Save jnthn/1080275 to your computer and use it in GitHub Desktop.
Save jnthn/1080275 to your computer and use it in GitHub Desktop.
C:\Consulting\rakudo>type TestRole.nqp
role TestRole {
method foo() {
say("hi from NQP");
}
}
my module EXPORT {
our module DEFAULT {
$?PACKAGE.WHO<TestRole> := TestRole;
}
}
C:\Consulting\rakudo>install\bin\nqp.exe --target=pir TestRole.nqp > TestRole.pir
C:\Consulting\rakudo>type NQPRoleTest.p6
use TestRole;
class P6Test does TestRole {
}
P6Test.foo;
C:\Consulting\rakudo>perl6 NQPRoleTest.p6
hi from NQP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment