<div style="white-space:pre-wrap">Functional programming style brings us a lot of joy, so the most important keyword shortening to support is obviously func -> fun. <br></div><div class="gmail_quote"><div dir="ltr">On Fri, Dec 11, 2015 at 08:06 Chris Lattner via swift-evolution <<a href="mailto:swift-evolution@swift.org" target="_blank">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 style="word-wrap:break-word"><div><blockquote type="cite"><div>On Dec 10, 2015, at 6:12 PM, Feijian Sun via swift-evolution <<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>> wrote:</div><br></blockquote></div></div><div style="word-wrap:break-word"><div><blockquote type="cite"><div><div dir="ltr" style="font-family:Calibri;font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div dir="ltr"><span style="color:rgb(68,68,68);font-size:15px;line-height:21.3px;background-color:rgb(255,255,255)">Hello, </span><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)"><br style="line-height:21.3px"></div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)">I have a proposal to replace the long keyword "subscript" with the shorter version, "subs". The idea is to keep the concise naming style on the language keywords, like "init" and "func".</div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)"><br style="line-height:21.3px"></div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)">So, Instead of:</div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)"><br style="line-height:21.3px"></div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)">subscript(index: Int) -> Int {</div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)"> ... ...</div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)">}</div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)"><br style="line-height:21.3px"></div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)">we could simply do:</div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)"><br style="line-height:21.3px"></div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)">subs(index: Int) -> Int{</div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)"><div style="line-height:21.3px"> ... ...</div><div style="line-height:21.3px">}</div></div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)"><br style="line-height:21.3px"></div><div style="line-height:21.3px;color:rgb(68,68,68);font-size:15px;background-color:rgb(255,255,255)">Does this mean a big change on the parser side? what do you think?</div></div></div></div></blockquote></div></div><div style="word-wrap:break-word"><div><blockquote type="cite"></blockquote><br></div><div>Hi Feijian,</div><div><br></div><div>I agree with Jack in this case that we should keep "subscript". Swift's rough approach to keywords is: </div><div><br></div><div>1) reuse contracted keywords that are widely known in the C family when the connotations are obvious (e.g. struct, enum, etc). </div><div>2) contract some “new” keywords for the *most commonly occurring* situations (e.g. func/var, though var is precedented in a number of extended c family languages like javascript), because people are expected to be forced to learn these things in the first few days of their swift learning.</div><div>3) otherwise, use a full word (subscript, convenience, mutating, etc).</div><div><br></div><div>In the case of subscript, it doesn’t occur often enough to be worth forcing people to memorize, and thus we prefer obvious clarity in the situations when it occurs in code.</div><div><br></div><div>-Chris</div><br>
<img src="https://u2002410.ct.sendgrid.net/wf/open?upn=1p9Jer2O6jVE9KWvo-2B9iUaEyN8slp4IizyiLwsfp54MMCdoQUkLGy7k8OLjRqukfvf-2Ba-2BvHLYUQot9ORssMPSKIb18E0LHMaNIAg9fenue-2FuCsl15kR-2FpVJ5Zo5rlJ9cm9Ilw9HLLxuhZPdC8seu2pnqiJrqK9mHNFbE5zGqk7NVdFK1gk-2F8zkpcp2yrneOHjDvQgdIoPnkXCMhLOL-2BgbmLqSPaaHdRBAkYQF27O-2BOE-3D" alt="" width="1" height="1" border="0" style="min-height:1px!important;width:1px!important;border-width:0!important;margin-top:0!important;margin-bottom:0!important;margin-right:0!important;margin-left:0!important;padding-top:0!important;padding-bottom:0!important;padding-right:0!important;padding-left:0!important">
</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>