In section 4.2 Create Term Definition of the Context Processing Algorithms, step 13, processing a reverse term ends with:
Set the term definition of term in active context to definition and the value associated with defined's entry term to true and return.
But with that early return, the algorithm stops processing a reverse term definition here, and thus reverse terms will not use any compaction features captured in the subsequent steps (step 19 and onward); e.g. indexed containers).
In section 4.2 Create Term Definition of the Context Processing Algorithms, step 13, processing a reverse term ends with:
But with that early return, the algorithm stops processing a reverse term definition here, and thus reverse terms will not use any compaction features captured in the subsequent steps (step 19 and onward); e.g. indexed containers).
Thus this example:
which should expand to:
instead results in:
since the term definition of
statement
is missing what term to use when interpreting the@index
value.The fix is simple: remove "and return" from the end of step 13, and revise step 14 to begin with "Otherwise".
This is consistent with playground and distiller behaviour, and by looking at implementation, e.g. the ruby implementation does not return early.
I have a fix for TRLD to reflect the above (applying that, example output changed accordingly to the expected behaviour).