Permalink
Browse files

[require] improve support for multi-joined namespaces

  • Loading branch information...
1 parent 3855ccb commit fb7d00a2f8ce4353224a8cf0d448c3b12dfb1e4d @moritz moritz committed Jun 10, 2012
Showing with 7 additions and 7 deletions.
  1. +7 −7 src/core/operators.pm
View
@@ -269,22 +269,22 @@ sub INDIRECT_NAME_LOOKUP($root, *@chunks) is rw {
}
sub REQUIRE_IMPORT($package-name, *@syms) {
- my $package := CALLER::OUR::{$package-name}.WHO;
- unless $package.exists('EXPORT') {
+ my $package = CALLER::OUR::($package-name);
+ my $who = $package.WHO;
+ unless $who.exists('EXPORT') {
die "Trying to import symbols @syms.join(', ') from '$package-name', but it does not export anything";
}
- $package := $package<EXPORT>.WHO<ALL>.WHO;
- say $package.keys;
+ $who := $who<EXPORT>.WHO<DEFAULT>.WHO;
my @missing;
for @syms {
- unless $package.exists($_) {
+ unless $who.exists($_) {
@missing.push: $_;
next;
}
- OUTER::CALLER::{$_} := $package{$_};
+ OUTER::CALLER::{$_} := $who{$_};
}
if @missing {
X::Import::MissingSymbols.new(:from($package-name), :@missing).throw;
}
- CALLER::OUR::{$package-name};
+ $package
}

0 comments on commit fb7d00a

Please sign in to comment.