-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Test plan for slicing/Range feature #23789
Comments
I've found that the generic type can not be used for enumerating such things like DateTime because the distance is measured by TimeSpan and not by DateTime. So if there are specific types should the range type for int be called IntRange? Because for math computations probably will be DoubleRange, for DateTime - DateTimeRange, and so on. |
Please make Range to be (Inclusive, Inclusive), as to me is indicative of a starting point and an end point. Making it exclusive also means the full range of values isn't available especially the If you want syntax support for Span, use a different symbol .
example ' span = index :: length
span s = 0 :: 10;
span<char> = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"[s]; 'eg ABCDEFGHIJ Dim r = 0 To 9 Step 3 ' eg 0 3 6 9 |
Alternatively name it |
Couldn't be possible to provide generic range and specialized one for Time-related stuff which would be silently switched by compiler if possible when compiler see Time-related class? As was mentioned, Range seems to be very useful in many scenarios not only strictly numerical, like If that not possible, at least consider adding those two ranges ( BTW for Cartesian or any space, really, be it 3D or nD i imagine something like
This is just clarification what i had in mind when mentioned Cartesian use case, not very enticing but different than the already mentioned and imagine how much separate range checks you would have to write for, let say, 12 dimensional space. |
Closing in favor of #23205 |
This is a placeholder to track test ideas and open issues.
We should be able to finalize Range API by end of Jan (including review with LDM), so the implementation can be completed in Feb.
Various aspects of proposal:
int
. LongRange would belong
.foreach (var i in 1..10)
it makes sense for 10 to be excluded. In5.in(1..10)
it makes some sense for 10 to be included. Overall, we’re leaning towards excluding the End.Test ideas:
foreach (var i in 10..0) // decreasing
ForEachToFor
refactoring should recognize range syntaxVarious links:
The text was updated successfully, but these errors were encountered: