-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Range operator #90
Comments
From my understanding there are two more or less conflicting viewpoints in regards to this issue. The viewpoint presented here is to construct array-like structures from a range, more or less a shorthand for a list/array literal, and the other is that of indexing/slicing. In my opinion, an inclusive..exclusive approach makes much more sense for purposes of indexing due to 0-indexing, while an inclusive..inclusive approach makes more sense for the list/array literal shorthand. I just think it'd feel weird to have On the topic of indexing/slicing, there's also a whole host of open questions in that area, particularly whether range indexing should construct a completely new collection (ex. |
Yeah, I think |
Range operator would be really neat adition for the language. It would construct a collection of ints from specified bounds.
Question is if the bounds should be included or excluded from the constructed collection. In my opinion the left bound should be included and the right one excluded, so
0..4
would construct collection looking like this:[0, 1, 2, 3]
Proposed Syntax
The syntax could be
left_bound..right_bound
The text was updated successfully, but these errors were encountered: