Right. I disentangled the part that I'd need and ended up with (almost) half the code from Want.xs. Speed issues aside, that's not reasonable.
what happens if someone assigns the return from gimme_a_ref() to a scalar, and then attempts to dereference it later?
That would be no different from other autovivifying situations. You can say
but you can't keep $x->{hihi} for later, as inmy $x; $x->{hihi}->{haha} = 'hoho';
So I'm not worried much about that effect, but the autovivifying option is out for the reason above.my $x; my $y = $x->{hihi}; $y->{haha} = 'hoho';
Alter is already using ..., two levels of inside-out-style dereferencing
It's not quite as bad. Alter::ego is one hash access slower than the inside-out equivalent Hash::Util::refaddr. That's the difference that matters afaik, otherwise they do about the same amount of almost nothing.
Anno
In reply to Re^6: Autovivifying XS routine
by Anno
in thread Autovivifying XS routine
by Anno
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |