develooper Front page | perl.perl5.porters | Postings from April 2018

Re: [perl #133109] push on scalar forbidden: why?

Thread Previous | Thread Next
From:
Dave Mitchell
Date:
April 22, 2018 18:16
Subject:
Re: [perl #133109] push on scalar forbidden: why?
Message ID:
20180422181635.GL2839@iabyn.com
On Sat, Apr 21, 2018 at 07:56:48PM -0700, L A Walsh wrote:
> No algorithm will work for all input.  That doesn't mean you throw out
> division because you can't divide by 0.

The big difference between the two is that there's (in general) no
practical alternative to using division, while the auto-deref form can be
avoided by the trivial syntactical addition of a '@' or '%' to the source
code, plus possibly {} for precedence issues. Or use the recent posfix
forms.

So there's a very modest gain for allowing push $r, while there are many
drawbacks, requiring documentation for all the special cases, and those
special cases limiting the usefulness of the feature (like breaking
overloading).

This feature, and its removal, has already been extensively discussed;
it's problematical, and its not going to be re-added.

-- 
Art is anything that has a label (especially if the label is "untitled 1")

Thread Previous | Thread Next


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