[swift-evolution] [swift-evolution-announce] [Review] SE-0040 Replacing Equal Signs with Colons For Attribute Arguments

Brent Royal-Gordon brent at architechies.com
Thu Mar 3 04:34:59 CST 2016


> https://github.com/apple/swift-evolution/blob/master/proposals/0040-attributecolons.md

> 	• What is your evaluation of the proposal?

In favor, but with the tiniest little hesitation.

Here's why: Last I heard, the plan was to apply behaviors with the attribute syntax. If we decide to allow you to pass parameters to behaviors, the syntax we use for that feature will surely be affected by this proposal:

	@json(key="id") var ID: Int
	@json(key: "id") var ID: Int

I *do* think that `:` is probably better than `=` for behaviors too, but before we leap, I recommend we take a few extra minutes to look at how this might interact with behaviors.

> 	• Is the problem being addressed significant enough to warrant a change to Swift?

It's a small inconsistency, but it also has a small solution. I think it's worth addressing.

> 	• Does this proposal fit well with the feel and direction of Swift?

I think it does, but see my comments above about behaviors.

> 	• If you have used other languages or libraries with a similar feature, how do you feel that this proposal compares to those?

In most languages I've worked with, attributes are an unholy mess, and sometimes appear to have been designed specifically to be as ungainly as possible. This is a marked improvement.

> 	• How much effort did you put into your review? A glance, a quick reading, or an in-depth study?

I was (as far as I know) the first to suggest the change on swift-evolution.

-- 
Brent Royal-Gordon
Architechies



More information about the swift-evolution mailing list