Replies: 5 comments 8 replies
-
I think we have to keep these two, if nothing else for coffeeCompat mode. However, we could alias one or both of them:
|
Beta Was this translation helpful? Give feedback.
-
Civet inherited ranges from CoffeeScript which I believe got them from Ruby which got them from Perl which I think got them from AWK or maybe Bash sequence expansions. Currently Civet, CoffeeScript, and Ruby have the same/similar range semantics. I think Ruby semantics being well established is a good enough reason to keep it as is unless there is a much stronger and well known consensus in other popular languages. Adding aliases could be a reasonable compromise as well. |
Beta Was this translation helpful? Give feedback.
-
FWIW, My best attempt at a mnemonic:
Personally, I mainly use We've discussed adding Python's |
Beta Was this translation helpful? Give feedback.
-
In case it helps anyone else, unless/until we get some "nicer" notation (I also like bbrk24's original suggestion of adopting both "More dots, fewer elements." |
Beta Was this translation helpful? Give feedback.
-
We have a whole new suite of slice notation via #1476! |
Beta Was this translation helpful? Give feedback.
-
I always get
0..n
and0...n
backwards because the one with more dots looks like it should include more, so I assume that's the one that includes the right endpoint and the one with fewer dots is the one that leaves it out. But actually it's the other way 'round. I doubt at this point there's much to be done about that, except I am hoping someone here might have another mnemonic to suggest to displace this "obvious" one from my head. Thoughts?Beta Was this translation helpful? Give feedback.
All reactions