[swift-evolution] Optional Setting
jj at johanjensen.dk
Tue Dec 15 16:59:53 CST 2015
a = a ?? 
which is a shorthand for
a = a ? a : 
For some reason I find it slightly weird to see ?= but that might just be
because I’m not used to seeing it.
On Tue, Dec 15, 2015 at 11:53 PM, James Campbell via swift-evolution <
swift-evolution at swift.org> wrote:
> Would be great to have a ?= syntax.
> So if
> var a: [String]? is nil then
> a ?= 
> will set it with a new array but if it already has a value then it won't
> do anything :)/
> james at supmenow.com
> +44 7523 279 698
> swift-evolution mailing list
> swift-evolution at swift.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-evolution