<div dir="ltr">+1, seems right to me. The original email wasn&#39;t clear to me, but this example is.<div><br></div><div>FWIW, as a user of the language I&#39;d hope that throwing subscript getters/setters would be written &quot;set throws { ... }&quot; and/or &quot;set(newValue) throws { ... }&quot; rather than &quot;throwing set { ... }&quot;, for consistency with function bodies.</div><div class="gmail_extra"><br></div><div class="gmail_extra">...and now that I&#39;m thinking about it, I&#39;m almost tempted to recommend &quot;subscript[_ example: Int]: Element&quot;. Is that too crazy?</div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>Jacob<br></div></div></div></div>
<br><div class="gmail_quote">On Sun, Jul 10, 2016 at 4:18 PM, James Froggatt 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">Currently, the signature is:<br>
subscript(_ example: Int) -&gt; Element {<br>
    get { … }<br>
    set { … }<br>
}<br>
<br>
The alternative, using a colon, would be:<br>
subscript(_ example: Int) : Element {<br>
    get { … }<br>
    set { … }<br>
}<br>
<br>
Sorry if that wasn&#39;t clear.<br>
<br>
This would be to better reflect the property-like nature of access.<br>
<br>
>From James F<br>
<div class="HOEnZb"><div class="h5"><br>
On 10 Jul 2016, at 23:57, Brent Royal-Gordon &lt;<a href="mailto:brent@architechies.com">brent@architechies.com</a>&gt; wrote:<br>
<br>
&gt;&gt; On Jul 9, 2016, at 11:48 AM, James Froggatt via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; Subscripts are a hybrid of properties and functions, since they have a parameter list, as well as getters and setters, so use of either symbol will be unusual in this case.<br>
&gt;&gt;<br>
&gt;&gt; However, I think a colon is more suitable, since it implies the possibility to set the value.<br>
&gt;<br>
&gt; Can you show us an example of the current syntax and your proposed replacement? I&#39;m not sure what you actually mean by &quot;use colons&quot;.<br>
&gt;<br>
&gt; --<br>
&gt; Brent Royal-Gordon<br>
&gt; Architechies<br>
&gt;<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>