General Category > Implementation Details

CTC (partial, full, none)

(1/1)

lerno:
I'd like some clarification on how this one works and what the expectation is for each state.

bas:
CTC = Compile Time Constant.

--- Code: ---const i32 a = 32; // CTC full
const i32 b = a; // CTC full

// expr's:
i32 c = 10; // NOTE: c not const
3 + a; // CTC full
c; // CTC none
3 + c; // CTC partial (some sub-expr is FULL)

--- End code ---

CTC full expressions are checked for value by the analyser (no casts needed then)

Also CTC full expressions can be evaluated at compile time and just added to the code as that value.

lerno:
Of what use is CTC partial? I don't really see it.

Navigation

[0] Message Index

Go to full version