[swift-evolution] [Discussion] Modernizing Attribute Case and Attribute Argument Naming

Erica Sadun 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

Proposal: TBD
Author(s): Erica Sadun <http://github.com/erica>
Status: TBD
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.

 <https://gist.github.com/erica/29c1a7fb7f49324d572f#alternatives-considered>Alternatives Considered

There are no alternatives for this proposal.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160217/9947edd6/attachment.html>

More information about the swift-evolution mailing list