Skip to content
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

Fix the range-operator for "backwards" ranges. #100

Merged
merged 1 commit into from
Nov 22, 2023
Merged

Fix the range-operator for "backwards" ranges. #100

merged 1 commit into from
Nov 22, 2023

Conversation

skx
Copy link
Owner

@skx skx commented Nov 22, 2023

This pull-request closes #98, by ensuring that the range operator (..) can count down as well as up. This allows ranges such as:

  • 3..10
  • 4..0

However note that the first number cannot be negative, as that's then treated as "- [1, 2..]" - i.e. negative array, which makes no sense. This should be resolved, but it is a bigger job.

This pull-request closes #98, by ensuring that the range operator
(`..`) can count down as well as up.  This allows ranges such as:

* 3..10
* 4..0

However note that the first number cannot be negative, as that's
then treated as "- [1, 2..]" - i.e. negative array, which makes
no sense.  This should be resolved, but it is a bigger job.
@skx skx merged commit 6c4e83f into master Nov 22, 2023
1 check passed
@skx skx deleted the 98-range branch November 22, 2023 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Range operator assumes increasing direction
1 participant