Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^2: Pugs Tic Tac

by revdiablo (Prior)
on Apr 25, 2005 at 17:18 UTC ( [id://451276]=note: print w/replies, xml ) Need Help??


in reply to Re: Pugs Tic Tac
in thread Pugs Tic Tac

Yuck. I want my old trinary operator back.

You use it often enough that The addition of two extra characters makes you say "yuck"? I mean, it works exactly the same. It looks nearly exactly the same. It just has two of each character instead of one.

Update: don't want my position to hinge on how often people use the operator.

Replies are listed 'Best First'.
Re^3: Pugs Tic Tac
by japhy (Canon) on Apr 25, 2005 at 17:31 UTC
    What has the single ''?'' been usurped for?? I can''t remember.. Or is the problem that ""everyone wants the colon"",, so a doubled colon was needed,, leading to a doubled question mark??

    Jeff japhy Pinyan, P.L., P.M., P.O.D, X.S.: Perl, regex, and perl hacker
    How can we ever be the sold short or the cheated, we who for every service have long ago been overpaid? ~~ Meister Eckhart

      I think it was the colon, yeah. I could be wrong -- my memory on this is a bit hazy -- but I seem to remember the trinary operator is what prevented the single colon from being used before. Doubling the colon requires doubling the question mark to look reasonably balanced.

      And funnily enough, I didn't realize you had doubled all your punctuation until after I had read your reply a second or third time. I almost spit soda all over my keyboard because of that. :-)

      Update: from Exegesis 3:

      The ?? and :: are the new way we write the old ?: ternary operator in Perl 6. Larry had to change the spelling because he needed the single colon for marking adverbs. But it's a change for the better anyway --it was rather odd that all the other short-circuiting logical operators (&& and || and //) used doubled symbols, but the conditional operator didn't. Well, now it does. The doubling also helps it stand out better in code, in part because it forces you to put space around the :: so that it's not confused with a package name separator.
        The doubling also helps it stand out better in code, in part because it forces you to put space around the :: so that it's not confused with a package name separator.
        Aha! Another sneaky instance of required whitespace! (What will this do to golf scores?)

        -QM
        --
        Quantum Mechanics: The dreams stuff is made of

        Ok, thanks for reminding me. I knew the answer would be in some Exegesis somewhere...

        Jeff japhy Pinyan, P.L., P.M., P.O.D, X.S.: Perl, regex, and perl hacker
        How can we ever be the sold short or the cheated, we who for every service have long ago been overpaid? ~~ Meister Eckhart
Re^3: Pugs Tic Tac
by cog (Parson) on Apr 25, 2005 at 19:33 UTC

    You use it often enough that two extra characters makes you say "yuck"?

    I do.

    I mean, it works exactly the same. It looks nearly exactly the same. It just has two of each character instead of one.

    It's an increase of 100%, you know? :-)

    But please note: I'm not saying that I'm against the change or anything. With time, I'll probably enjoy it. I just wanted to make it perfectly clear that some people use the ternary operator a lot.

    And I'm proudly one of them :-)

    print "$users user", ( $users == 1 ? '' : 's'), " currently use the ternary operator.\n";

      to be completely gramatically correct, you've got to modify the verb as well ;-)
      print "$users user", ( $users == 1 ? '' : 's'), " currently use",( $users == 1 ? 's' : ''), " the ternary operator.\n";
        Eh.

        And I changed my sentence, because the first version was "There are currently $users using...", and that would have me changing the "are" to "is" too :-)

        Oh well :-)

      Ok, I knew I should have avoided the appeal to frequent use. That always lands me in hot water, because for every feature there is bound to be at least one person who uses it all the time. Of course, the trinary operator is probably used frequently by quite a bit more than one person, but you know. :-)

Log In?
Username:
Password:

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

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

    No recent polls found