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

Re^3: What operator should perl5porters use for safe dereferencing?

by xiaoyafeng (Chaplain)
on Jun 05, 2012 at 10:16 UTC ( #974427=note: print w/ replies, xml ) Need Help??


in reply to Re^2: What operator should perl5porters use for safe dereferencing?
in thread What operator should perl5porters use for safe dereferencing?

Thanks for your correction! But the 3 first main usages of ~ is about match. I suggest ?-> is I believe the one of advantages which perl6 is better than perl5 is its consistency. take a look below:

  • ~ means string, so ~$foo change $foo into string context, and $foo1 ~ $foo2 make a concatenation.
  • +/- means numeric, so +$foo change $foo into numeric context and $foo + 3 is doing mathematic operation.
  • and ? means bool, * means global etc.......
as we see, in perl6, every sigil has its own consistent meaning and easily for learning. I don't say ~> is bad, I just want every new grammar/op adding during perl5 evolved should keep consistent.




I am trying to improve my English skills, if you see a mistake please feel free to reply or /msg me a correction


Comment on Re^3: What operator should perl5porters use for safe dereferencing?
Re^4: What operator should perl5porters use for safe dereferencing?
by BrowserUk (Pope) on Jun 05, 2012 at 12:37 UTC
    I don't say ~> is bad, I just want every new grammar/op adding during perl5 evolved should keep consistent.

    Too late. Tilde already has a full house of contextual overloads:

    print ~'fred';; print ~12345;; 18446744073709539270 print ~( 2 != 2 );; 18446744073709551615 print ~~( '2' eq '2' );; 1 ~\'fred';; ╝│Τ═╩פ

    One more is neither here nor there.


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

    The start of some sanity?

Re^4: What operator should perl5porters use for safe dereferencing?
by Anonymous Monk on Jun 06, 2012 at 03:05 UTC

    as we see, in perl6, every sigil has its own consistent meaning and easily for learning

    ~ is not a sigil. Its not a sigil in perl5 and its not a sigil in perl6. Also, perl5 is not perl6

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (8)
As of 2014-12-28 13:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (181 votes), past polls