Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^7: RFC: "assignary" operator ?= : (rareness)

by shmem (Chancellor)
on Dec 10, 2019 at 11:19 UTC ( [id://11109906]=note: print w/replies, xml ) Need Help??


in reply to Re^6: RFC: "assignary" operator ?= :
in thread RFC: "assignary" operator ?= :

Just the .pm files in the perl core distribution contain over 700,000 lines. You show that those, combined with a bunch of 3rd party modules, contain only around 100 instances of code likely to be able to make use of this proposed operator.

To be exact, in that amount of code I've found 77 instances.
And I have found 192 lines of code (two and a half times as much) which use the defined-or //=.

If anything I think you've shown that this is a very rare use case and hardly justifies its addition to core.

A bit more rare than the defined-or assignment operator //=, but anyways. Among 700.000 lines, 192 isn't that much either, so rareness of use cases isn't exactly a reason for an operator to be included or not.

perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'

Replies are listed 'Best First'.
Re^8: RFC: "assignary" operator ?= : (rareness)
by ikegami (Patriarch) on Dec 10, 2019 at 20:46 UTC

    192 isn't that much either

    I'm not surprised, especially on CPAN. || and // can often be used interchangeably, and || is more backwards compatible.

Re^8: RFC: "assignary" operator ?= : (rareness)
by LanX (Saint) on Dec 10, 2019 at 11:58 UTC
    > Among 700.000 lines, 192 isn't that much either,

    Backwards compatibility?

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery FootballPerl is like chess, only without the dice

      Backwards compatibility?

      Core modules need not to be written in a backaward compatible way in terms of operators they use. The core must be backward compatible wrt third party modules and existing code bases outside of itself.

      perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'
        I'd say most core modules are older than the // operator.

        Cheers Rolf
        (addicted to the Perl Programming Language :)
        Wikisyntax for the Monastery FootballPerl is like chess, only without the dice

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2024-04-25 22:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found