Author Topic: CTC (partial, full, none)  (Read 6254 times)

lerno

  • Full Member
  • ***
  • Posts: 247
    • View Profile
CTC (partial, full, none)
« on: December 01, 2018, 05:34:50 PM »
I'd like some clarification on how this one works and what the expectation is for each state.

bas

  • Full Member
  • ***
  • Posts: 220
    • View Profile
Re: CTC (partial, full, none)
« Reply #1 on: December 02, 2018, 11:56:34 AM »
CTC = Compile Time Constant.
Code: [Select]
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)

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

  • Full Member
  • ***
  • Posts: 247
    • View Profile
Re: CTC (partial, full, none)
« Reply #2 on: February 12, 2019, 12:47:59 AM »
Of what use is CTC partial? I don't really see it.