develooper Front page | perl.perl5.porters | Postings from August 2013

[perl #119437] [EXPERIMENT] autoderef, the implicit deref in push REF and others

Thread Previous | Thread Next
From:
Ricardo SIGNES
Date:
August 23, 2013 01:47
Subject:
[perl #119437] [EXPERIMENT] autoderef, the implicit deref in push REF and others
Message ID:
rt-3.6.HEAD-1873-1377222451-1522.119437-75-0@perl.org
# New Ticket Created by  Ricardo SIGNES 
# Please include the string:  [perl #119437]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org:443/rt3/Ticket/Display.html?id=119437 >


Perl 5.14.0 introduced this behavior, described in perl5140delta as:

  Array and hash container functions accept references

  Warning: This feature is considered experimental, as the exact
  behaviour may change in a future version of Perl.

  All builtin functions that operate directly on array or hash containers
  now also accept unblessed hard references to arrays or hashes:

  [table]

  This allows these builtin functions to act on long dereferencing chains
  or on the return value of subroutines without needing to wrap them in
  "@{}" or "%{}":

The behavior of autoderef changed between David Golden's original work and the
final shipped product.

Specific questions:

* do we revert the behavior changes, at least in some cases?
* do we add an 'experimental' warning for perl 5.20 if the experiment isn't
  "accepted" yet by then?
* does this feature stick around if postfix deref is added

On the third point, my current thought is that it seems like removing it just
because a maybe-better form came around is going to lead to the same kind of
groaning that we've gotten with the addition of warnings for ~~ in perl 5.18.0.
Is it worth that?  Current thoughts on *that*:  I really don't know.  It's not
like the feature will not be useful anyway...

Anyway, the general question is the same as any other [EXPERIMENT] ticket:

What are the criteria for accepting or rejecting this experiment?

-- 
rjbs


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