[swift-evolution] Proposal: Replace ?? by an (optional) argument to ?

Nate Birkholz nbirkholz at gmail.com
Mon Jan 25 21:21:55 CST 2016


-1 

?? Is compact and expressive and useful quite often. It's clear and  simple and clearly related to similar symbols. When writing objective-c code I often find myself wishing for ?? as it often is more useful than the ternary operator.

Sent from my iPhone, please excuse brevity and errors

> On Jan 25, 2016, at 6:03 PM, Amir Michail via swift-evolution <swift-evolution at swift.org> wrote:
> 
> Examples:
> 
> * instead of x ?? false, you would have x?(false)
> * instead of x?.isEmpty ?? false, you would have x?(false).isEmpty
> 
> I think this change would result in cleaner looking code.
> 
> 
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution


More information about the swift-evolution mailing list