Skip to content

Commit

Permalink
'is copy' for array and hash params.
Browse files Browse the repository at this point in the history
  • Loading branch information
jnthn committed Dec 19, 2013
1 parent 9cf4e13 commit f1ba138
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Perl6/Metamodel/BOOTSTRAP.nqp
Expand Up @@ -311,7 +311,9 @@ my class Binder {
# and a normal bind is a straightforward binding.
if $flags +& $SIG_ELEM_ARRAY_SIGIL {
if $flags +& $SIG_ELEM_IS_COPY {
nqp::die('array is copy binding NYI');
my $bindee := nqp::create(Array);
$bindee.STORE($decont_value);
nqp::bindkey($lexpad, $varname, $bindee);
}
else {
nqp::bindkey($lexpad, $varname, $decont_value);
Expand All @@ -321,7 +323,9 @@ my class Binder {
# If it's a hash, similar approach to array.
elsif $flags +& $SIG_ELEM_HASH_SIGIL {
if $flags +& $SIG_ELEM_IS_COPY {
nqp::die('hash is copy binding NYI');
my $bindee := nqp::create(Hash);
$bindee.STORE($decont_value);
nqp::bindkey($lexpad, $varname, $bindee);
}
else {
nqp::bindkey($lexpad, $varname, $decont_value);
Expand Down

0 comments on commit f1ba138

Please sign in to comment.