Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Stub the new INITIALIZEr for dynamic system vars
  • Loading branch information
lizmat committed Sep 7, 2014
1 parent e9181cd commit 7f6c240
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/core/stubs.pm
Expand Up @@ -34,13 +34,22 @@ sub DYNAMIC(\name) is rw {
elsif nqp::existskey(PROCESS.WHO, $pkgname) {
$x := nqp::atkey(PROCESS.WHO, $pkgname);
}
elsif try INITIALIZE(name) -> $result {
$x := $result;
}
else {
fail X::Dynamic::NotFound.new(:name(name));
}
}
$x
}

# prime the automagic dynamic variable initializers
proto sub INITIALIZE(|) { * }
#multi sub INITIALIZE('$*FOO') { # example stub
# PROCESS::<$FOO> := "foo";
#}

# Set up ClassHOW's auto-gen proto (nested scope so it won't
# actually appear in the setting).
{
Expand Down

0 comments on commit 7f6c240

Please sign in to comment.