develooper Front page | perl.perl5.porters | Postings from June 2015

Re: extraneous autovivification (foreach (@$x), keys(%$x), ...)

Thread Previous | Thread Next
Aristotle Pagaltzis
June 30, 2015 23:57
Re: extraneous autovivification (foreach (@$x), keys(%$x), ...)
Message ID:
* Christian Millour <> [2015-07-01 01:40]:
> interestingly, foreach (@{...}) defeats 'no autovivification' :

I’m not surprised, as this is not rvalue context: foreach really does
evaluate the expression in lvalue context, so this is expected. But it
really only needs lvalueness for individual items – semantically, the
expression that generates them should be in rvalue context, as Leon has
already pointed out. I don’t know if that is implementable, though. If
it is, it would be worth a shot at fixing.

(NB.: I don’t know how actually goes about achieving
its effect at a guts level, so I may be unsurprised for the wrong reason
as far as that pragma is concerned. The above reasoning is WRT Perl.)

Aristotle Pagaltzis // <>

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About