Skip to content
This repository was archived by the owner on Sep 10, 2025. It is now read-only.

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

Merged
skx merged 1 commit intomasterfrom
98-range
Nov 22, 2023
Merged

Fix the range-operator for "backwards" ranges.#100
skx merged 1 commit intomasterfrom
98-range

Conversation

@skx
Copy link
Copy Markdown
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
@skx skx deleted the 98-range branch November 22, 2023 14:56
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Range operator assumes increasing direction

1 participant