Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement foreign namespace protocol
I beleive this to be the last critical piece for Rakudo work.
- Loading branch information
Showing
2 changed files
with
31 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# vim: ft=perl6 | ||
|
||
plan(2); | ||
|
||
pir::load_bytecode("perl5.pir"); | ||
my $p5 := pir::compreg__ps("perl5"); | ||
|
||
$p5.make_interp(' | ||
package Foo::Bar; | ||
sub Method { | ||
my ($self, $x, $y) = @_; | ||
return $x + $y; | ||
} | ||
')(); | ||
|
||
my $ns := $p5.get_namespace('Foo::Bar'); | ||
|
||
ok(pir::defined($ns), "can get namespaces for packages"); | ||
|
||
ok($ns.Method(1,3,7) == 4, "can call package methods"); |
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