Re:Apple is patenting Swift features
by lalaithion on Friday January 25, 2019 @10:49AM
(#18998936)
Right, but isn't `?.` just syntactic sugar on `Option::and_then`? Is this a patent on a piece of syntactic sugar, or is it a patent on the idea of chaining optional values?
Ruby does seem to have the exact thing: http://mitrev.net/ruby/2015/11/13/the-operator-in-ruby/
That is, in Rust you'd use Option::map or Option::and_then, there is no equivalent to the `?.` and `?[]` operators, the `?` operator (or `try!` macro) is a shortcut for an "unwrapping guard".