Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR removes stepped ranges from the language (e.g.,
0..5..20
). Why?range 0..2..
should either error or actually select every other row. (Either way, theevery
command already covers this use case.)1.
stepped ranges have limited support. In the process of writing this PR, I didn't find a single command that handled, let alone even used the step value (Some commands that handle ranges don't account for the step value #11521).seq
command already exists, and it should have all the same functionality.Edit: stepped ranges would allow for stepped slicing (e.g., like
arr[start:end:2]
in python). Not sure what the common use case for this is, but I'm guessing 2d arrays and images where a row stride is desired. However, I'm not sure how applicable or useful this would be for nushell. E.g., operations are usually over streams, and theevery
command already covers stepping behavior for streams.As a side effect, this PR fixes #9417 (panic while parsing ranges).
User-Facing Changes
This will break existing code that uses stepped ranges. Users will have to switch to using
seq
.After Submitting
Update the book and language guide. Language grammars will also need to be updated.