[swift-evolution] Colon vs. equals

Brent Royal-Gordon brent at architechies.com
Sat Feb 6 17:57:38 CST 2016


> In Ruby there is a special syntax for hash
> 
> [ "key" => "value"] which makes it less ambiguous compared to =

I'm familiar with this in Ruby (and Perl, where it originated), and I think that `:` is strictly superior to `=>`. (When Ruby 2 introduced `a: x` as a shorthand for `:a => x`, I jumped on it immediately and never looked back.) The *only* reason to change to `=` is to match dictionary assignment; `=>` doesn't do that.

-- 
Brent Royal-Gordon
Architechies



More information about the swift-evolution mailing list