Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: What operator should perl5porters use for safe dereferencing?

by Arunbear (Parson)
on May 30, 2012 at 10:39 UTC ( #973251=note: print w/ replies, xml ) Need Help??


in reply to What operator should perl5porters use for safe dereferencing?

I prefer ?-> because it makes it clear that there might not be a receiver for the message send ->, much more than ~> which suggests that some kind of pattern or smart match is involved. In the Groovy language, they call it the Safe Navigation Operator e.g.

def streetName = user?.address?.street


Comment on Re: What operator should perl5porters use for safe dereferencing?
Select or Download Code
Re^2: What operator should perl5porters use for safe dereferencing?
by gregor42 (Parson) on May 30, 2012 at 15:54 UTC

    I do not personally care for ?-> because it reminds me of the ternary operator.

    I voted for ~> due to terseness & the implication of flexibility



    Wait! This isn't a Parachute, this is a Backpack!

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2015-07-04 22:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (60 votes), past polls