Skip to content

Change repeat syntax and add range repeats#252

Open
diondokter wants to merge 1 commit into
masterfrom
range-repeats
Open

Change repeat syntax and add range repeats#252
diondokter wants to merge 1 commit into
masterfrom
range-repeats

Conversation

@diondokter

@diondokter diondokter commented Jun 19, 2026

Copy link
Copy Markdown
Owner

Repeats are now:

  • Count: [3::2]
    • Len = 3
    • Stride = 2
  • Range: [3:1:2]
    • End = 3 (inclusive)
    • Start = 1
    • Len = 3
    • Stride = 2
  • Enum: [Foo:2]
    • Stride = 2

But!
The meaning of number 3 changes from exclusive in the count scenario and inclusive in the range scenario. Not sure about that.
But making the count be inclusive feels super wrong since it's such a strong convention in languages to specify arrays with the len, not the last index.

While the order of start and end are different, the range syntax here is inspired by python (and matches the field address range expression).

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.

1 participant