[swift-evolution] Proposal for Replacing Keyword "subscript" with "subs"‏

Feijian Sun feijian_sun at hotmail.com
Fri Dec 11 06:41:07 CST 2015


Okay, I see your points. Thanks for response!

Subject: Re: [swift-evolution] Proposal for Replacing Keyword "subscript" with "subs"‏
From: clattner at apple.com
Date: Thu, 10 Dec 2015 21:06:52 -0800
CC: swift-evolution at swift.org
To: feijian_sun at hotmail.com


On Dec 10, 2015, at 6:12 PM, Feijian Sun via swift-evolution <swift-evolution at swift.org> wrote:Hello, 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".So, Instead of:subscript(index: Int) -> Int {        ... ...}we could simply do:subs(index: Int) -> Int{        ... ...}Does this mean a big change on the parser side? what do you think?
Hi Feijian,
I agree with Jack in this case that we should keep "subscript".  Swift's rough approach to keywords is: 
1) reuse contracted keywords that are widely known in the C family when the connotations are obvious (e.g. struct, enum, etc).  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.3) otherwise, use a full word (subscript, convenience, mutating, etc).
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.
-Chris
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20151211/e72affe4/attachment.html>


More information about the swift-evolution mailing list