Just as the title asks, is there an operator, or some snazzy one liner to do the above?
To clarify, if this is the first time a is being referenced, and b is nil, a shouldn’t persist past the evaluation of b being nil.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There is no operator that I know of. Your response is already one line … If you really wanted you can change the if ! to unless.