Skip to content

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

Open

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions