Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'setenv' into nom

  • Loading branch information...
commit 110f35cce02bff36428407ef715cbb9245c88130 2 parents 2a962e3 + 616b622
Tadeusz Sośnierz tadzik authored
Showing with 12 additions and 0 deletions.
  1. +12 −0 src/core/terms.pm
12 src/core/terms.pm
View
@@ -15,6 +15,18 @@ sub term:<time>() { nqp::p6box_i(pir::time__I()) }
$key = nqp::p6box_s(pir::shift__SP($enviter));
%ENV{$key} = nqp::p6box_s(nqp::atkey($env, nqp::unbox_s($key)));
}
+ %ENV does role {
+ method at_key($k) {
+ Proxy.new(
+ FETCH => {
+ nqp::p6box_s(nqp::atkey($env, nqp::unbox_s($k)))
+ },
+ STORE => -> $, $v {
+ nqp::bindkey($env, nqp::unbox_s($k), nqp::unbox_s($v))
+ }
+ )
+ }
+ }
nqp::bindkey(pir::get_who__PP(PROCESS), '%ENV', %ENV);
my $VM = {
Please sign in to comment.
Something went wrong with that request. Please try again.