<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Sun, Jul 10, 2016 at 10:42 PM, Erica Sadun 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:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="">> On Jul 10, 2016, at 5:18 PM, James Froggatt via swift-evolution <<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>> wrote:<br>
><br>
> 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>
</span>It all depends on whether a subscript is more function-y or property-y, and don't forget subscripts can take parameters and labels.<br>
<br>
let y = myArrayOfStrings[safeIndex: 2, fallback: "foo"]<br>
<span class="HOEnZb"><font color="#888888"><br>
-- E</font></span></blockquote><div><br></div><div>But isn't it the getter and setter which are really function-y? That's why you can write "set(myVariableName) { ... }" </div></div></div></div>