#Inline static lookup table/array
1 messages · Page 1 of 1 (latest)
by inline do you mean something like this?
Array[10] = {10,20,....};
If so, I don't know of any way. There is no syntax for arrays of literals.
You can define constant variables, but not arrays of them afaik.
constant variables are read only
for example:
import std.io;
const u8 a;
a=2;
a=3; // Runtime Error! cant assign to const
std::print("{}",a);
const u8 A[2];
A[0] = 2;
A[0] = 3; // No error
std::print("{}",A);