by laogai · 8y ago · 0 comments
At first I hated it because of how incomprehensible it was to someone coming from seemingly every other language, but I've started to use it more and more and wishing it existed in other languages.
It's especially useful for when the variable access is many characters. e.g. `if hackerNews.frontPage.votingCircleExists:` with nil checks is `if hackerNews && hackerNews.frontPage && hackerNews.frontPage.votingCircleExists`
and with & operator is: `if hackerNews&.frontPage&.votingCircleExists`.
Edit: I was mistaken, it's a little different. This is more like groovys safe navigation ?.