in reply to Re: What is the + in +shift doing here?
in thread What is the + in +shift doing here?

And shift() saves two keystrokes vis a vis to the more clear shift(@_). Some people are alarmingly implicite variable-averse.

Luckily, many people that are parenthesis-averse, or implicite variable-averse program in a language more suitable for them.

Replies are listed 'Best First'.
Re^3: What is the + in +shift doing here?
by Roy Johnson (Monsignor) on Feb 24, 2005 at 15:26 UTC
    There's nothing "more clear" about shift(@_). We're talking about disambiguating something; to make it clear that it's a function call, parentheses make the most sense. There is nothing ambiguous about leaving the argument implicit, and there's certainly nothing alarming about using implicit variables, just as there's nothing alarming about omitting the parentheses. But using a + instead of the parentheses is economy at the expense of clarity, which is alarming.

    The coward posts anonymously, then logs in to downvote the response.
      to make it clear that it's a function call, parentheses make the most sense.
      Really? That's something uniformly agreed on? People write +shift for the purpose of being unclear?

      I disagree. I couldn't care less whether you find parentheses or unary minus more or less clear, or what makes the most sense to you. But you will find me disagreeing with you each and every time you make such statements as if they are undeniable universal truths.

      But using a + instead of the parentheses
      It's not instead of parentheses. It's instead of using an argument. Or using it in a longer expression. Or instead of parenthesis around the function call. It's just one of many ways to make it not like a bareword.
        Really? That's something uniformly agreed on?
        Yes. Parentheses connote a function call. + does not.
        People write +shift for the purpose of being unclear?
        No, and I didn't say they did. They write + to be economical. The side-effect is that they are less clear.
        you will find me disagreeing with you
        That might carry some weight if you were a real Perl Monk with some reputation of your own, instead of someone hiding behind Anonymous.

        If you want to quibble about what it's instead of, it's instead of writing something that connotes a function call.


        Caution: Contents may have been coded under pressure.