ink icon indicating copy to clipboard operation
ink copied to clipboard

Allow basic computation and references to other constants in CONST definition

Open brwarner opened this issue 5 months ago • 0 comments

Right now, a CONST must be defined as either a number or divert target.

CONST MyConstant = 5

However, it's frequently useful to define constants in reference to other constants.

CONST SunriseTime = 6
CONST Breakfast = SunriseTime // Constant equals an existing constant
CONST Lunch = Breakfast + 6 // Constant equals a constant expression

So this request is two-fold:

  • Support for defining a constant as the value of another constant
  • Support for defining a constant by a constant expression (arithmetic on other constants)

This could all be resolved at compile-time, so it may actually be purely an inklecate feature with no ink/inkjs/etc. implications.

brwarner avatar Aug 07 '25 15:08 brwarner