Skip to content

Add extension to reference previous statement value #3

@vaexey

Description

@vaexey

Currently, only the last statement in the expression is returned.
Add a feature that allows to reference a value from previous statements.

In the example below, only the result of 5 + 6 can be captured and 1 + 2 with 3 + 4 value is lost.

$ alc "1 + 2; 3 + 4; 5 + 6"
11

Example syntax that could be supported:

alc "1 + 2; 3 + 4; 5 + 6; result[0] + result[1] + result[2]"
21
alc "1 + 2; 3 + 4; 5 + 6; previous(2)"
7

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions