develooper Front page | perl.perl5.porters | Postings from February 2020

Re: [perl #2166] foreach spuriously autovivifies

Thread Previous
From:
demerphq
Date:
February 6, 2020 06:17
Subject:
Re: [perl #2166] foreach spuriously autovivifies
Message ID:
CANgJU+UfVGSqAKdL+OrsjwhvmPhkBcfHWosJsRhjutHSCtRBQQ@mail.gmail.com
On Mon, 10 Feb 2014 at 12:02, Dave Mitchell <davem@iabyn.com> wrote:

> On Sun, Feb 09, 2014 at 11:16:03AM -0800, Father Chrysostomos via RT wrote:
> > On Mon Jan 27 03:35:27 2014, davem wrote:
> > > 4.77 s passing elements that already exist
> > > 9.36 s creating and passing PVLV proxies
> > > 4.23 s autovivifing, then passing
> > >
> > > (and no, I don't understand why autovivifying is slightly faster than
> > > them
> > > already existing.)
> >
> > If I could change that (make PVLVs fast), would you be willing to change
> > your mind?
>
> Yes.
>

Im again defelem magic in general as it breaks the mental of how
autovivification works.  Right now, for normal code its relatively easy to
explain when something autovivifies. With the added defelem magic to arrays
this becomes more complex, and is inconsistent with hash behavior as well.

Id go so far as to say the bug is that we introduced it at all. Sorry to
say that given how much effort must have been involved, but well, there you
go.

cheers,
Yves

-- 
perl -Mre=debug -e "/just|another|perl|hacker/"

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About