All expressions have a value stage which dictate which stage of compilation it may be used in.
Constexpr values are values that are known at compile-time and can be used as constexpr expressions. Anywhere that requires a comptime or a runtime value also accept constexpr values.
The following are constexpr expressions:
literals
def variables
Comptime values are values that may be used inside a constexpr function but are not constexpr themselves. Anywhere that requires a runtime values also accept comptime values.
The following are comptime expressions:
const variables
const variables
defined in a constexpr functionvar variables
defined in a constexpr functionRuntime values are values that may only be used at runtime as they are not known and/or cannot be calculated at compile-time. Anywhere that that requires a runtime value also accept comptime and constexpr values.
The following are runtime expressions:
var variables
var variables
and const variables
declared in function scope