5 Commits

Author SHA1 Message Date
ge
93a610fa02 feat: add bounds(), make Range private back 2026-03-24 21:43:46 +03:00
ge
808870ff09 feat: add start-end[/step] syntax support, make Range public @[noinit] 2026-03-24 21:04:32 +03:00
ge
74e92c77ab feat: add with_step(), reset() 2026-01-11 03:13:01 +03:00
ge
4306b2220c breaking,fix: remove range exclusivity support
The usefulness of this feature is questionable, and its correct implementation
is difficult due to the use of generics. The implementation worked incorrectly
in cases where the iterator step is not equal to one and is not a multiple of
the end element. For example, for `range(0, 7, 4)`, the result is `[0]`
instead of `[0, 4]`. After this commit range end value is always included.

To check for multiples, a user-defined type must also implement an overload of
the remainder operator (`%`), even if the exclusivity function is not needed.

Another correct implementation requires subtracting one from the end element
for integers and the minimum fractional part supported by the type for floats.
This cannot be done correctly for generics, as it requires casting the literal
to a specific type, and we cannot cast number to any type.
2025-12-30 12:19:35 +03:00
ge
b9b57ad93f init 2025-12-26 22:38:52 +03:00