For example, a lookup table of bytes might be declared as
const LOOKUP_TABLE: array[4, byte] = [1, 2, 3, 4]
but that gives a type mismatch as the numbers are interpreted as int. Of course one can do [byte(1), byte(2), byte(3), byte(4)], but the numbers are quite lost in the noise! Is there a better way?You can specify just the first member:
const LOOKUP_TABLE: array[4, byte] = [byte(1), 2, 3, 4]
In any case, you have to indicate at least that the first value is a byte. For instance:
const LOOKUP_TABLE: array[4, byte] = [1'u8, 2, 3, 4]
or more elegant
const LOOKUP_TABLE: array[4, byte] = [byte 1, 2, 3, 4]