<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div><div style="direction: inherit;"><span style="background-color: rgba(255, 255, 255, 0);">* What is your evaluation of&nbsp;<a href="x-apple-data-detectors://3" dir="ltr" x-apple-data-detectors="true" x-apple-data-detectors-type="misc" x-apple-data-detectors-result="3" style="-webkit-text-decoration-color: rgba(0, 0, 0, 0.258824);">the proposal</a>?</span></div><div style="direction: inherit;"><div style="direction: inherit;"><br></div><div style="direction: inherit;">-1.&nbsp;</div><div style="direction: inherit;"><br></div><div style="direction: inherit;">To me, subscripts have always seen more functions than properties for the fact that they can take arbitrary number of arguments. If we were to "clean up" its syntax, I'd rather align it with functions. Something along the lines of</div><div style="direction: inherit;"><br></div><div style="direction: inherit;">&nbsp; subscribe(get) func foo(_ x: X) -&gt; Y</div><div style="direction: inherit;">&nbsp; subscribe(set) func foo(_ y: Y)</div><div style="direction: inherit;"><span style="background-color: rgba(255, 255, 255, 0);"><br></span></div><div style="direction: inherit;"><span style="background-color: rgba(255, 255, 255, 0);">&nbsp;* Is the problem being addressed significant enough to warrant a change to Swift?</span></div><div style="direction: inherit;"><span style="background-color: rgba(255, 255, 255, 0);"><br></span></div><div style="direction: inherit;"><span style="background-color: rgba(255, 255, 255, 0);">No. More importantly, the change is a regression visually.</span></div><div style="direction: inherit;"><span style="background-color: rgba(255, 255, 255, 0);"><br></span></div><div style="direction: inherit;"><span style="background-color: rgba(255, 255, 255, 0);">* Does this proposal fit well with the feel and direction of Swift?</span></div><div style="direction: inherit;"><span style="background-color: rgba(255, 255, 255, 0);"><br></span></div><div style="direction: inherit;"><span style="background-color: rgba(255, 255, 255, 0);">It's an attempt of a syntax dress-up.</span></div><div style="direction: inherit;"><span style="background-color: rgba(255, 255, 255, 0);"><br></span></div><span style="background-color: rgba(255, 255, 255, 0);">* If you have used other languages or libraries with a similar feature, how do you feel that this proposal compares to those?</span></div><div style="direction: inherit;"><div style="direction: inherit;"><br></div><div style="direction: inherit;">Python's __getitem__() method, C++'s [] operator are some analogous examples. Non -of them pretend not to be a function. The users of these features appear to be satisfied by the decision.</div><div style="direction: inherit;"><br></div><span style="background-color: rgba(255, 255, 255, 0);">&nbsp;* How much effort did you put into your review? A glance, a quick reading, or an in-depth study?</span></div><div style="direction: inherit;">&nbsp;</div><div style="direction: inherit;">Quick read of proposal and discussion on ML.</div><div style="direction: inherit;"><br></div><div>Daniel Duan</div>Sent from my iPhone</div><div><br>On Jul 20, 2016, at 10:17 AM, Jose Cheyo Jimenez via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>&gt; wrote:<br><br></div><blockquote type="cite"><div><meta http-equiv="Content-Type" content="text/html charset=utf-8"><br class=""><div><blockquote type="cite" class=""><div class="">On Jul 20, 2016, at 7:51 AM, Vladimir.S via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">+1 to clean up the syntax of subscripts. They acts as properties, not methods, so it is natural to express them with `:` and not with `-&gt;`.<br class=""><br class="">Actually, I'd prefer additional change to use [] instead of () in declaration like:<br class=""><br class="">subscript[externalName internalName: ParamType] : ElementType {<br class=""> &nbsp;&nbsp;&nbsp;get { … }<br class=""> &nbsp;&nbsp;&nbsp;set { … }<br class="">}<br class=""></div></div></blockquote><div><br class=""></div><div>I got to second this suggestion. To me this is an elegant solution.&nbsp;</div><div><br class=""></div><div>If subscripts are so special that Swift decided to give it its own name (as oppose to just making it two functions),&nbsp;</div><div>why not declare it in a special way like the above?</div><div><br class=""></div><div>I think that in addition to replacing -&gt; with : if we replaced () with [] then it would be much clearer that this is not a function or property.&nbsp;</div><div><br class=""></div><div><pre style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6px; margin-top: 0px; margin-bottom: 16px; font-variant-ligatures: normal; font-variant-position: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; line-height: 1.45; word-wrap: normal; padding: 16px; overflow: auto; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; color: rgb(51, 51, 51); widows: 1; background-color: rgb(247, 247, 247);" class=""><code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6px; padding: 0px; margin: 0px; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-break: normal; border: 0px; display: inline; overflow: visible; line-height: inherit; word-wrap: normal; background-color: transparent; background-position: initial initial; background-repeat: initial initial;" class="">subscript[externalName internalName: ParamType] : ElementType {
    get { … }
    set { … }
}</code></pre><div class=""><br class=""></div><div class="">I don’t see another place in the language where [] would make more sense than here:&nbsp;</div><div class="">Otherwise I don’t see &nbsp;replacing -&gt; with : as a big win like Dmitri Gribenko said down thread -&gt;</div><div class=""><br class=""></div><div class=""><blockquote type="cite" class=""><blockquote type="cite" class="">I think by&nbsp;changing subscripts to use colons we would end in the opposite, but<br class="">totally symmetrical situation compared to what we have now.<br class=""></blockquote></blockquote></div><div class=""><br class=""></div></div><div>&nbsp;</div><br class=""><blockquote type="cite" class=""><div class=""><div class=""><br class="">especially if thinking about "Future directions" and confusion with parameterised accessor syntax(both declared with `()` but first used with `[]` and second with `()`).<br class=""><br class="">On 20.07.2016 8:50, Chris Lattner via swift-evolution wrote:<br class=""><blockquote type="cite" class="">Hello Swift community,<br class=""><br class="">The review of "SE-0122: Use colons for subscript declarations " begins now and runs through July 24. The proposal is available here:<br class=""><br class=""><span class="Apple-tab-span" style="white-space:pre">        </span><a href="https://github.com/apple/swift-evolution/blob/master/proposals/0122-use-colons-for-subscript-type-declarations.md" class="">https://github.com/apple/swift-evolution/blob/master/proposals/0122-use-colons-for-subscript-type-declarations.md</a><br class=""><br class="">Reviews are an important part of the Swift evolution process. All reviews should be sent to the swift-evolution mailing list at<br class=""><br class=""><span class="Apple-tab-span" style="white-space:pre">        </span><a href="https://lists.swift.org/mailman/listinfo/swift-evolution">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class=""><br class="">or, if you would like to keep your feedback private, directly to the review manager.<br class=""><br class="">What goes into a review?<br class=""><br class="">The goal of the review process is to improve the proposal under review through constructive criticism and contribute to the direction of Swift. When writing your review, here are some questions you might want to answer in your review:<br class=""><br class=""><span class="Apple-tab-span" style="white-space:pre">        </span>* What is your evaluation of the proposal?<br class=""><span class="Apple-tab-span" style="white-space:pre">        </span>* Is the problem being addressed significant enough to warrant a change to Swift?<br class=""><span class="Apple-tab-span" style="white-space:pre">        </span>* Does this proposal fit well with the feel and direction of Swift?<br class=""><span class="Apple-tab-span" style="white-space:pre">        </span>* If you have used other languages or libraries with a similar feature, how do you feel that this proposal compares to those?<br class=""><span class="Apple-tab-span" style="white-space:pre">        </span>* How much effort did you put into your review? A glance, a quick reading, or an in-depth study?<br class=""><br class="">More information about the Swift evolution process is available at<br class=""><br class=""><span class="Apple-tab-span" style="white-space:pre">        </span><a href="https://github.com/apple/swift-evolution/blob/master/process.md">https://github.com/apple/swift-evolution/blob/master/process.md</a><br class=""><br class="">Thank you,<br class=""><br class="">-Chris Lattner<br class="">Review Manager<br class=""><br class="">_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a><br class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class=""><br class=""></blockquote>_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class=""></div></div></blockquote></div><br class=""></div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>swift-evolution mailing list</span><br><span><a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a></span><br><span><a href="https://lists.swift.org/mailman/listinfo/swift-evolution">https://lists.swift.org/mailman/listinfo/swift-evolution</a></span><br></div></blockquote></body></html>