[swift-evolution] Add unless/if single line syntax

James Campbell james at supmenow.com
Sat Dec 12 07:39:23 CST 2015


I propose adding the unless and if statements from ruby.

Return false if james = nil

This returns false if the variable James is nil
. This line does it unless james is nil:

Return false unless james = nil

This has been really handy when working in ruby, reduces lines and pyramids of doom

Sent from my iPhone


More information about the swift-evolution mailing list