+1 as well. It always feels a little weird to be writing a setter inside something that says it returns what should be the argument.<br><div class="gmail_quote"><div dir="ltr">On Mon, Jul 11, 2016 at 00:05 Patrick Pijnappel via swift-evolution <<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Good point. A subscript basically a parameterized property, not a function. I'm in favor.</div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jul 11, 2016 at 9:18 AM, James Froggatt via swift-evolution <span dir="ltr"><<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>></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) -> 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't clear.<br>
<br>
This would be to better reflect the property-like nature of access.<br>
<br>
>From James F<br>
<div><div><br>
On 10 Jul 2016, at 23:57, Brent Royal-Gordon <<a href="mailto:brent@architechies.com" target="_blank">brent@architechies.com</a>> wrote:<br>
<br>
>> On Jul 9, 2016, at 11:48 AM, James Froggatt via swift-evolution <<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>> wrote:<br>
>><br>
>> 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>
>><br>
>> However, I think a colon is more suitable, since it implies the possibility to set the value.<br>
><br>
> Can you show us an example of the current syntax and your proposed replacement? I'm not sure what you actually mean by "use colons".<br>
><br>
> --<br>
> Brent Royal-Gordon<br>
> Architechies<br>
><br>
_______________________________________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org" target="_blank">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>
_______________________________________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org" target="_blank">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>
</blockquote></div>