Kaljurand/Unitconv — Issue #3: Backreferences
Author: Kaljurand
Created: 2011-10-27 14:43:07+00:00
State: open

Since each list item is essentially a number (i.e. an evaluation result of an arithmetical or unit conversion expression) it would be cool to feed existing numbers into future expressions.

Use case
-------------

The expression grammar does not allow:

> e to the power of (pi times i)

because it parses everything as left-associative. One could solve this problem by two utterances:

> 1. pi times i
> 2. e to the power of LAST

where `LAST` is linearized into some sort of variable which will be bound to the value found on the top of the history stack. After evaluation the history stack will become:

> 2. -1
> 1. pi * i

;)