Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^6: RFC: "assignary" operator ?= :

by dave_the_m (Monsignor)
on Dec 09, 2019 at 22:32 UTC ( #11109889=note: print w/replies, xml ) Need Help??


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

So, it looks like there are plenty of use cases
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. If anything I think you've shown that this is a very rare use case and hardly justifies its addition to core.

Dave.

Replies are listed 'Best First'.
Re^7: RFC: "assignary" operator ?= :
by LanX (Cardinal) on Dec 09, 2019 at 23:49 UTC
    > you've shown that this is a very rare use case

    Plus many of these use cases are dubious and merit a new variable name for the sake of clarity.

    I'm a strong proponent of orthogonality, but I strongly doubt the costs of implementing this will ever pay off at this stage of language design.

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

Re^7: RFC: "assignary" operator ?= : (rareness)
by shmem (Chancellor) on Dec 10, 2019 at 11:19 UTC
    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'

      192 isn't that much either

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

      > 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'

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (7)
As of 2020-07-02 05:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?