-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Summary
Add range iteration and indexed loop sugar to improve loop ergonomics.
Proposed Syntax
for i in 0..10 {}
for i in 0..10 by 2 {}
for elem, i in list {}
Semantics
a..bis end-exclusivebysets step (default 1)for elem, i in listis indexed sugar over list + range index generation
Scope
- Parser/type-checker/runtime support for range literals and
by - Indexed loop sugar lowering/expansion rules
- Validation for invalid zero step and incompatible bounds/step types
Out of Scope
- Infinite ranges (
0..) - Reverse/descending shorthand beyond explicit negative step
- Multi-iterable zip (tracked separately)
Acceptance Criteria
for i in 0..5 {}iterates0,1,2,3,4for i in 0..10 by 2 {}iterates0,2,4,6,8for elem, i in list {}binds element and index correctly
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels