<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Slightly related to this, I would really love to have non-subscript parameterized properties. It would allow us to write<div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">button</span><span style="font-variant-ligatures: no-common-ligatures" class="">.image(</span><span style="font-variant-ligatures: no-common-ligatures; color: #ba2da2" class="">for</span><span style="font-variant-ligatures: no-common-ligatures" class="">: .normal) = </span><span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">image</span></div></div><div class=""><br class=""></div><div class="">instead of</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">button</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">.</span><span style="font-variant-ligatures: no-common-ligatures; color: #3e1e81" class="">setImage</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">(</span><span style="font-variant-ligatures: no-common-ligatures" class="">image</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">, </span><span style="font-variant-ligatures: no-common-ligatures; color: #ba2da2" class="">for</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">: .</span><span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">normal</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">)</span></div></div><div class=""><br class=""></div><div class="">The same can be achieved through subscripts, but it’s not always as nice. It would bring subscripts and computed properties closer together, which also seems to be the goal of your proposal. Perhaps the two ideas could be combined?<br class=""><div class=""><br class=""></div><div class="">> 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 class="">> <br class="">> However, I think a colon is more suitable, since it implies the possibility to set the value.<br class="">> <br class="">> <br class="">> In the future, if we add throwing getters/ setters:<br class="">> <br class="">> subscript(_ position: Int) ->Element {<br class="">> get {<br class="">> return …<br class="">> }<br class="">> throwing set {<br class="">> …<br class="">> }<br class="">> }<br class="">> <br class="">> Should this require ‘throws ->Element’? Using a colon also removes this potentially confusing case.<br class="">> <br class="">> <br class="">> Thoughts?<br class="">> <br class="">> <br class="">><span class="Apple-converted-space"> </span>
</div></div></body></html>