inkle / inkle/ink

Allow basic computation and references to other constants in CONST definition

Open
#952 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
4.9k
Forks
540
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.