[swift-evolution] [Review] SE-0030 Property Behaviors

Brent Royal-Gordon brent at architechies.com
Fri Feb 19 02:54:30 CST 2016


> It would be great if we could eventually nail down 'recommended semantics' for symbols like @, #, &, etc, and then normalize the language syntax to match. We have a couple of informal conventions emerging, but I find that (e.g.) trying to figure out why Language Feature X has a leading '@' rather than being a keyword is still rather difficult.

I think we're doing fine on that, actually:

* & marks unusual parameter passing semantics.

* @ marks attributes, and should only be attached to declarations. (And perhaps also used when accessing data associated with an attribute, like `foo.bar at resettable.reset()`.)

* # is for two things: either expressions with a certain amount of compiler magic involved, or commands that affect large-scale code structure.

Personally, I think of # as the prefix on all Swift 4 macros and @ as the prefix on all Swift N behaviors. The full features aren't here yet, but we've brought some specific use cases back from the future.

-- 
Brent Royal-Gordon
Architechies



More information about the swift-evolution mailing list