Uri Guttman wrote:

[ CCs stripped ]

> ... what if you passed \$a{llama}{alpaca}? even as a read only param,
> you could deref later through the ref in another sub that gets passed it
> from this sub. 


If I understand Dan's proposal (<a05111b55b977c7a65606@[63.120.19.221]>) 
for a change in the KEYed methods correctly, this would work, when 
additionaly the KEY get's passed on with the PMC.

my %a;
func (%a{llama}{alpaca});

new P0, .PerlHash
new P1, .KEY
set P1[0], "llama"
set P1[1], "alpaca"     # KEY chain P1{llama; alpaca}
setk? P0, P1    # assoc KEY chain P1 to P0
save P0
bsr func

func ($h is rw) {
   print $h;
   $h = 'wooly';
}

func:
pushp
restore P0
print P0        # get_p_keyed gets implicitly it's own KEY => undef
set P0, 'wooly' # set_p_keyed autovivs KEY (chain)
popp
ret

> ... but how to detect that at runtime is an issue. 


If the PMC carrys it's KEY around, this should work.


> uri

leo

Reply via email to