[swift-evolution] [Discussion] Modernizing Attribute Case and Attribute Argument Naming
erica at ericasadun.com
Wed Feb 17 12:18:00 CST 2016
For your consideration: Attribute Ophidiophobia. Feedback and suggestions welcome. -- Erica
Modernizing Attribute Case and Attribute Argument Naming
Author(s): Erica Sadun <http://github.com/erica>
Review manager: TBD
Two isolated instances of snake case remain in the Swift attribute grammar. This proposal updates those elements to bring them into compliance with modern Swift language standards.
The Swift-Evolution discussion of this topic took place in the "[Discussion] Modernizing Attribute Case and Attribute Argument Naming" thread. Hat tip to Michael Wells
<https://gist.github.com/erica/29c1a7fb7f49324d572f#motivation-and-detail-design>Motivation and Detail Design
Parts of the Swift attribute grammar retain lower snake case patterns that no longer match modern conventions:
The warn_unused_result attribute should use lowercase and be renamed warnunusedresult. The lower case pattern matches other compound attribute examples: autoclosure, objc, noescape, nonobjc, and noreturn.
The mutable_variant attribute argument should use lower camel case as is standard for native Swift argument labels and be renamed to mutableVariant.
Some non-native Swift attributes use a distinct pattern that does not apply to this proposal, specificallyUIApplicationMain, NSManaged, NSCopying, NSApplicationMain and do not fall under the scope of the native Swift lowercase convention.
There are no alternatives for this proposal.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-evolution