[swift-evolution] Colon vs. equals

David Sweeris davesweeris at mac.com
Mon Feb 8 14:55:31 CST 2016


Agreed.

- Dave Sweeris

> On Feb 8, 2016, at 11:56, Radosław Pietruszewski via swift-evolution <swift-evolution at swift.org> wrote:
> 
> My interpretation:
> 
> 1. “foo: bar” means “foo is bar”
> 2. “foo = bar” means “assign bar to foo”
> 
> So (2) should only be used for assignment to variables/constants, and when assigning default values to function parameters. (1) is more versatile and should be used in all other contexts.
> 
> IMHO:
> 
>> @available(iOS, introduced=7.0, deprecated=8.0)
> 
> should be changed to:
> 
>  @available(iOS, introduced: 7.0, deprecated: 8.0)
> 
> But aside from that, I don’t have beef with the colon being used in different contexts — looks cleaner and nicer than ` = ` to my eyes.
> 
> — Radek


More information about the swift-evolution mailing list