c3lang / c3c

Compiler for the C3 language
https://c3-lang.org
GNU Lesser General Public License v3.0
2.99k stars 184 forks source link

Slicing arrays, slices and bytes at compile time #1466

Open lerno opened 1 month ago

lerno commented 1 month ago

We want to support the slicing of arrays, slices and bytes at compile time. The suggestion is that first we allow compile time slices to implicitly convert to arrays. This makes semantics better and we pass around the data properly. So:

  1. [x] Slice bytes => bytes
  2. [x] Slice array/vector => constant slice
  3. [x] Slice constant slice => constant slice
  4. [x] Slice untyped list => untyped list
lerno commented 1 month ago

In dev