John Gardner (2016-01-24T06:10:42.000Z)
gardnerjohng at gmail.com (2016-01-24T06:15:11.622Z)
> *This has all the benefits you seek, including visual clarity, without > overloading the meaning of an existing token.* Actually, I beg to differ. Recall that this is valid syntax: ```js 1.. toString(16); ``` Furthermore, maintaining a 3-dot notation stays consistent with the rest and spread operators, both of which already overload each other. For sake of clarity for this discussion, I'll call this one the "range operator". > *I think this is one of those issues where the benefit of any new syntax > here does not pay for its complexity costs.* I don't foresee this raising any complexity issues. The syntax is intended chiefly as a way to specify multiple integers where indexed access is relevant. There wouldn't be any need to specify exclusive or inclusive expansion, because it'd always work inclusively. Which is what I believe every author would expect when they write `1 ... 5`. It would also enable one to write this: ```js func( 0 ... 5 ) ``` Instead of this: ```js func( ...[0, 1, 2, 3, 4, 5] ); ``` I can't speak on anybody else's behalf, but I know which of the two I'd prefer writing. Again, I'll state I don't expect this to be a groundbreaking feature. But it's simple, clean and (from what I understand) would be unintrusive to the language.
gardnerjohng at gmail.com (2016-01-24T06:14:20.367Z)
> *This has all the benefits you seek, including visual clarity, without > overloading the meaning of an existing token.* Actually, I beg to differ. Recall that this is valid syntax: ```js 1.. toString(16); ``` Furthermore, maintaining a 3-dot notation stays consistent with the rest and spread operators, both of which already overload each other. For sake of clarity for this discussion, I'll call this one the "range operator". > *I think this is one of those issues where the benefit of any new syntax > here does not pay for its complexity costs.* I don't foresee this raising any complexity issues. The syntax is intended chiefly as a way to specify multiple integer ranges where indexed access is relevant. There wouldn't be any need to specify exclusive or inclusive expansion, because it'd always work inclusively. Which is what I believe every author would expect when they write `1 ... 5`. It would also enable one to write this: ```js func( 0 ... 5 ) ``` Instead of this: ```js func( ...[0, 1, 2, 3, 4, 5] ); ``` I can't speak on anybody else's behalf, but I know which of the two I'd prefer writing. Again, I'll state I don't expect this to be a groundbreaking feature. But it's simple, clean and (from what I understand) would be unintrusive to the language.
gardnerjohng at gmail.com (2016-01-24T06:13:19.619Z)
> *This has all the benefits you seek, including visual clarity, without > overloading the meaning of an existing token.* Actually, I beg to differ. Recall that this is valid syntax: ```js 1.. toString(16); ``` Furthermore, maintaining a 3-dot notation stays consistent with the rest and spread operators, both of which already overload each other. For sake of clarity for this discussion, I'll call this one the "range operator". *I think this is one of those issues where the benefit of any new syntax > here does not pay for its complexity costs.* I don't foresee this raising any complexity issues. The syntax is intended chiefly as a way to specify multiple integer ranges where indexed access is relevant. There wouldn't be any need to specify exclusive or inclusive expansion, because it'd always work inclusively. Which is what I believe every author would expect when they write 1 ... 5. It would also enable one to write this: ```js func( 0 ... 5 ) ``` Instead of this: ```js func( ...[0, 1, 2, 3, 4, 5] ); ``` I can't speak on anybody else's behalf, but I know which of the two I'd prefer writing. Again, I'll state I don't expect this to be a groundbreaking feature. But it's simple, clean and (from what I understand) would be unintrusive to the language.