<div dir="ltr">Arguably, these are all framework/IDE-specific functionality, a.k.a. &quot;custom attributes&quot;, which should have an entirely different syntax.<div class="gmail_extra">
<br><div class="gmail_quote">On Wed, Feb 17, 2016 at 9:43 PM, Erica Sadun via swift-evolution <span dir="ltr">&lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">How would you re-design the existing upper camel attributes then?<br>
<br>
They are: @UIApplicationMain, @NSManaged, @NSCopying, @NSApplicationMain, @IBAction, @IBDesignable, @IBInspectable, and @IBOutlet<br>
<span class="HOEnZb"><font color="#888888"><br>
-- E<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
&gt; On Feb 17, 2016, at 10:29 PM, Brent Royal-Gordon &lt;<a href="mailto:brent@architechies.com">brent@architechies.com</a>&gt; wrote:<br>
&gt;<br>
&gt;&gt; @Autoclosure // was @autoclosure<br>
&gt;&gt; @Available // was @available<br>
&gt;&gt; @ObjC // was @objc<br>
&gt;&gt; @NoEscape // was @noescape<br>
&gt;&gt; @NonObjC // was @nonobjc<br>
&gt;&gt; @NoReturn // was @noreturn<br>
&gt;&gt; @Testable // was @testable<br>
&gt;&gt; @WarnUnusedResult // was @warn-unused-result<br>
&gt;&gt; @Convention  // was @convention<br>
&gt;&gt; @NoReturn // was @noreturn<br>
&gt;&gt;<br>
&gt;&gt; In the revised design, the following example for Swift 2.2<br>
&gt;&gt;<br>
&gt;&gt; @warn_unused_result(mutable_variant=&quot;sortInPlace&quot;)<br>
&gt;&gt; public func sort() -&gt; [Self.Generator.Element]<br>
&gt;&gt;<br>
&gt;&gt; becomes<br>
&gt;&gt;<br>
&gt;&gt; @WarnUnusedResult(mutableVariant: &quot;sortInPlace&quot;)<br>
&gt;&gt; public func sort() -&gt; [Self.Generator.Element]<br>
&gt;<br>
&gt; Wow, I&#39;m surprised by how much I hate this. Currently, all Swift keywords are entirely lowercase (ignoring things like `Type`, `Protocol`, and `dynamicType` which come after a dot). I think I&#39;ve learned to half-ignore things that look like that, but capitalizing suddenly pulls the spotlight onto these keywords. I&#39;m just not a fan.<br>
&gt;<br>
&gt; I think we&#39;re better off renaming or redesigning `warn_unused_result` so that it&#39;s readable when it&#39;s all-lowercase with no underscores. Some ideas:<br>
&gt;<br>
&gt;       @onlyreturns func sorted() -&gt; [Self.Generator.Element]<br>
&gt;       func sorted() -&gt; @important [Self.Generator.Element]<br>
&gt;<br>
&gt; Alternatively, we could reverse the semantic and make all all non-Void functions warn unless they have an attribute saying not to.<br>
&gt;<br>
&gt;       @ignoreresult mutating func updateValue(value: Value, forKey key: Key) -&gt; Value?<br>
&gt;       mutating func updateValue(value: Value, forKey key: Key) -&gt; @ignorable Value?<br>
&gt;       mutating func updateValue(value: Value, forKey key: Key) -&gt; @convenience Value?<br>
&gt;<br>
&gt; If we do that, we&#39;ll likely still want to be able to annotate non-mutating methods with their mutating variants (well, unless we think the compiler can guess based on the API Guidelines.)<br>
&gt;<br>
&gt;       @variant(mutating: &quot;sort&quot;) func sorted() -&gt; [Self.Generator.Element]<br>
&gt;       @alternative(mutating: &quot;sort&quot;) func sorted() -&gt; [Self.Generator.Element]<br>
&gt;<br>
&gt; That opens the possibility of using `@variant(nonmutating:)` on mutating functions, too.<br>
&gt;<br>
&gt; --<br>
&gt; Brent Royal-Gordon<br>
&gt; Architechies<br>
&gt;<br>
<br>
_______________________________________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
</div></div></blockquote></div><br></div></div>