duql computed array index: an Index node that ends the path
DecisionVerified 2 Oct 2026Holds anywhere
Decision. The context, the choice, why, and the options that were turned down.
Context#
Adding computed array indexes to duql (E7).
Decision#
A computed index parses as Index{base path, index expr} that ends the path (a[i].b is a parse error); PathStep::index stays a literal so scan paths and prefilter keep their shape; a[$n] with an integer parameter folds in bind_params into the literal step.
Why#
Ending the path and keeping PathStep::index literal preserves the scan-path and prefilter shapes that other stages rely on.
Rejected options#
A postfix index on any expression (no member access on values).
Also found by searching
- computed index parses as Index base path plus index expr and ends the path
- a[i].b is a parse error
- PathStep::index stays a literal so scan paths and prefilter keep their shape
- a[$n] with an integer parameter folds in bind_params