Posted September 17, 2024 by Tom Mulgrew
v1.2.4 has been released with a couple of nice-to-have language features:
Constants and parameters can be literals (10, "foo", true), other constants (including built-in ones like MATH_PI), or expressions (const LEFT_BUTTON = BASE_BUTTON + 0x01;). Essentially they must evaluate to a constant value at compile time.
Constant/default expressions cannot contain function calls (even if the result is deterministic).
Array, struct and library type parameters (like Image, Data) can have default values, but that default value can only be "null".
Under the hood, the compiler is now better at collapsing constant expressions at compile time, meaning they will compile to more compact and efficient code.