# Slice range notation format

**URL:** <https://ziggit.dev/t/slice-range-notation-format/15299>\
**Category:** Brainstorming\
**Created:** [May 3, 2026, 2:11pm UTC](https://ziggit.dev/t/slice-range-notation-format/15299 "2026-05-03T14:11:24Z")\
**Posts on this page:** 1\
**Showing post:** 14

<div class="post-metadata">

**Author:** ![Sze](https://ziggit.dev/user_avatar/ziggit.dev/sze/32/496_2.png) [@Sze](https://ziggit.dev/u/Sze)\
**Post date:** [May 4, 2026, 10:55am UTC](https://ziggit.dev/t/slice-range-notation-format/15299/14 "2026-05-04T10:55:28Z")

</div>

If you use something like this:

```zig
fn calc(a: u6, b: u6) void {
    const l:u7, const u:u7 = if (a < b) .{a, b} else .{b, a};
    for (l..u + 1) |v| {
    }
}

```

There is no overflow danger because currently in zig `v` is a usize.  
But I would also like if we could have typed smaller indices like this:

> [@If you had one wish for zig, what would it be?](https://ziggit.dev/t/if-you-had-one-wish-for-zig-what-would-it-be/15069/20):
>
> For me it would also be for loop counting variable types, including the ability to do this: for (0..32) |i: u5| {} // max value does not have to fit the type

---

_[View the full topic](https://ziggit.dev/t/slice-range-notation-format/15299)._
