# 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:** 16

<div class="post-metadata">

**Author:** ![Gaweringo](https://ziggit.dev/user_avatar/ziggit.dev/gaweringo/32/7550_2.png) [@Gaweringo](https://ziggit.dev/u/Gaweringo)\
**Post date:** [October 27, 2026, 10:39pm UTC](https://ziggit.dev/t/slice-range-notation-format/15299/16 "2026-10-27T22:39:41Z")

</div>

Adding to this somewhat old thread..  
I personally am generally fond of clearer indications of inclusive and exclusive ranges like `..<` and `..=`.

Something that could also be nice in the realm of slice syntax would be the ability to specify start + length. Something like `[start..+10]`. Thought of this while looking through this thread: [Reading integers from dynamic address - #2 by dbushell](https://ziggit.dev/t/reading-integers-from-dynamic-address/8927/2)

Something else that is related to slicing/ranges, which I know from VHDL, but might also be available in Ada (or others), is the ability to use ranged integer types as slices/ranges, which would require [#3806](https://github.com/ziglang/zig/issues/3806).

As an example from VHDL where a new integer subtype with a range from 0 to 255 is declared, and used to specify the range / size of an array type:

```vhdl
subtype ram_addr_t is natural range 0 to 255;
type ram_t is array(ram_addr_t) of word_t;
signal ram : ram_t;

```

The integer type can also be used to take a slice from an array:

```vhdl
subtype opcode_range_t is natural 31 downto 26;
subtype instruction_t is bit_vector(31 downto 0);
signal instruction : instruction_t;
-- Later ...
opcode := instruction(opcode_range_t); -- ( ) are used to index into arrays

```

---

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