| Store | Cart

Re: Concerning the branch smoke-me/arc/deprecate-delete-array

From: Father Chrysostomos <spr...@cpan.org>
21 Aug 2014 03:37:58 -0000
Aristotle wrote:
> > If the adjustment of $#foo by delete $foo[...] is the main reason for> > deprecating it, then why not just stop delete from changing the> > length?> > That seems merely differently confusing to me.> > I’m pretty sure the same will be the case no matter how you twiddle the> semantics. That is the problem really.> > It’s only exacerbated by the presence of `each @array` too. All of those> features really weren’t well-conceived.

I don't know why you find it confusing.  I have been programming
in JavaScript for eighteen years and have never found the feature
confusing there.  I was delighted when I found that Perl has the
same feature.

I can imagine a clothesline with many evenly-spaced pegs, most of
which have stockings (scalars) on them.  Some are empty (undef), some
hold numbers, etc.  In a few places, the pegs have nothing on them at
all, but are just waiting for stockings to be placed on them.  The
absence of stockings does not affect the length of the line.

> Would it be an option for you to make the syntax hookable to the extent> that you could reimplement that feature for your scripts without having> the language itself have to support your scripts in perpetuity?

It is already hookable via PL_check.  But if perl's internal array
functions stop supporting this, then I would have to tie every array
affected or hook all array operations to keep things in synch.  It
seems like more bother than it is worth.  (Not upgrading seems rather
attractive by comparison.)

I don't think removing the feature would actually help anyone.

BTW, I agree that 'each @array' was not well-conceived.  No so for
sparse arrays.

Recent Messages in this Thread
Father Chrysostomos Aug 21, 2014 03:37 am
Aristotle Pagaltzis Aug 21, 2014 05:37 am
Aristotle Pagaltzis Aug 21, 2014 05:44 am
Aristotle Pagaltzis Aug 19, 2014 06:46 pm
Messages in this thread