plum
git clone https://git.pyrossh.dev/plum
A statically typed, imperative programming language inspired by rust, python
06dbe56
— Peter John
2026-10-26T21:20:19+05:30
docs(plans): pre-task R — n.times()/a.until(b)/to/downTo replace range
docs/plans/2026-10-27-zig-errors.md
CHANGED
|
@@ -85,3 +85,21 @@ Tests:
|
|
|
85
85
|
- `error_union_boxed_in_list`;
|
|
86
86
|
- `nullable_ref_still_null`;
|
|
87
87
|
- `bang_crash_message_uses_name`.
|
|
88
|
+
|
|
89
|
+
## Pre-task R (user decision; runs after the docs audit and before E1): Int loop methods replace the global `range`
|
|
90
|
+
|
|
91
|
+
- `extend Int` with `fun*` methods:
|
|
92
|
+
- `times(self) *Int` gives 0..self-1;
|
|
93
|
+
- `until(self, end: Int) *Int` gives self..end-1;
|
|
94
|
+
- `to(self, end: Int) *Int` is inclusive;
|
|
95
|
+
- `downTo(self, end: Int) *Int` counts down, inclusive.
|
|
96
|
+
- Steps use `Seq.stepBy`. The global `fun* range` is deleted, with the hint "write n.times() or a.until(b)", and all ~70 uses are migrated.
|
|
97
|
+
- No implicit `for i := 10`.
|
|
98
|
+
|
|
99
|
+
Tests:
|
|
100
|
+
- `times_loop_is_tight` (the old `range_loop_is_tight` test adapted to `n.times()`);
|
|
101
|
+
- `until_to_downTo_bounds`, including empty ranges such as `5.until(5)` and `1.downTo(2)`;
|
|
102
|
+
- `stepBy_on_until`;
|
|
103
|
+
- `range_removed_hint`.
|
|
104
|
+
|
|
105
|
+
Update the docs, the iteration cheat sheet, highlighting and the LSP method completion for Int.
|