Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^3: Experimental push on scalar now forbidden

by stevieb (Canon)
on May 21, 2017 at 19:09 UTC ( [id://1190811]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Experimental push on scalar now forbidden
in thread Experimental push on scalar now forbidden

There have to be discussions as to the reasoning (typically, an experiment (certain operations such as push, pop etc on a scalar is one such experiment that made it into 5.14) don't work out. The majority of the time, a failure is due to a possible interference with future design considerations. This particular experiment was removed from 5.23 (dev track for 5.24).

In this case, I haven't found out the discussions regarding any debates on this particular topic, but per perlexperiment for 5.24.0, it's clear that this feature was dropped for the Postfix Dereference syntax. tybalt89 provided an example of that, here.

Of course, you can and always have been able to use the "circumfix operator" to push to a reference... push @{ $href->{aref} }, ...; or just a straight-up deref push @$aref, ...;.

update: I said above: "The majority of the time, a failure is due to a possible interference with future design considerations."

That may have been inaccurate, as I don't have statistics on the matter. Perl devs are under the order of perlpolicy, where the number one rule is to do their best to honour backwards-compatibility. Some of the experiments get downthumbed or footshot because something comes up that breaks things that used to work, is considered a "feature", and still need to work. My use of "majority" was wrong, as I truly don't know. I do know that at least some get written off due to future considerations, but I also know that some die due to breaking past compat, even if they live for a while.

Replies are listed 'Best First'.
Re^4: Experimental push on scalar now forbidden
by KurtZ (Friar) on May 21, 2017 at 20:13 UTC
    Thanks! Personally I never used it because I had too many problems with experimental features in the past.

    I haven't found out the discussions regarding any debates on this particular topic,

    But I'm still interested to know where the new syntax led to problems. :)

      I'm on many tangents at the moment so I don't have the time to forge through to find it, but often, you can find discussion links within the perlexperiment documents for each version, as well as perldelta docs.

      I'll have some time later, so state whether you've found something or not. If not, I'll dig up some conversations on the topic later when I can and post back.

      I typically keep up with these things, but a long time has passed and I've forgotten. All this despite the fact I rarely ever use features beyond perl 5.8.9, unless I'm literally testing the experiments to learn (postderef was one I toyed with amongst many), or things I use for quick one-off test scripts while testing my distributions (say() out of 5.10 for example).

        state (added in Perl 5.10) can be really nice. Reference aliasing (added in Perl 5.22) is also awesome, but seems too new to rely on. In quick mock-ups, I often find myself using package Foo::Bar { ... } syntax (added in Perl 5.14) but that's trivial to replace with { package Foo::Bar; ... } before distributing the code.

        Thanks and no worries! :)

        My question wasn't directed especially at you but at the general audience here.

        And haukex already provided some good pointers.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1190811]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (4)
As of 2024-04-19 05:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found