[swift-evolution] [Review] SE-0056: Allow trailing closures in `guard` conditions

Thorsten Seitz tseitz42 at icloud.com
Tue Apr 5 00:19:11 CDT 2016


> Am 05.04.2016 um 01:52 schrieb Dany St-Amant via swift-evolution <swift-evolution at swift.org>:.
> 
> I am with you here, Swift is Swift, C is C, Swift should not be hampered by keeping the syntax identical to C. But, it seems that most prefer to type less, so we should be really careful with proposing new keywords like this 'then' and 'do' as they carry little meaning,  have to be mandatory (as per Chris), and are really needed only for trailing closure which will not be used by everyone.
> 
> So, I'm against adding these 'then' and 'do' keywords for the sake of providing the trailing support to 'if' and 'for'.

FWIW adding 'then' would allow using 'if' as an expression by replacing the {...} blocks with expressions. One argument against 'if' expressions was that { } are ugly within an expression. So there might be a benefit besides providing trailing support.

-Thorsten 


More information about the swift-evolution mailing list