Skip to content

Allow basic computation and references to other constants in CONST definition #952

@brwarner

Description

@brwarner

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions