[swift-evolution] Proposal: Optional Binding Shorthand Syntax

Zef Houssney zefmail at gmail.com
Thu Dec 3 13:52:48 CST 2015


Hello. This is exciting!

I have an idea I’ve been mulling over for a while to reduce a common source of clutter in Swift code.

The idea is to introduce a new syntax for Optional Binding:

Instead of:

if let foo = foo { } 

You could simply use:

if let foo { } 


I’ve written up a draft of a proposal here with additional information and motivations:
https://github.com/zef/swift-evolution/blob/master/proposals/00xx-optional-binding-shorthand.md


What do you think?

Thank you!


More information about the swift-evolution mailing list