Evaluation-time host abstraction for the formula evaluator.
Remarks
The host is the only thing evaluate talks to. Every cell
read goes through FormulaHost.readNumber; the evaluator
itself contains no graph, no resolver, no coercion table. This is
the public surface that the eventual Rust evaluator port must
satisfy — both implementations consume the same Ast and
produce the same FormulaResult, differing only in how the
host resolves cell IDs to numeric values.
Error semantics. A host may return a FormulaError for
any failure: missing cell, non-numeric upstream value, propagated
upstream error, or backing-store-specific I/O failure. The
evaluator treats unresolved-ref specially inside range
aggregations (skipped silently to match spreadsheet idiom) and
surfaces every other error category by short-circuiting evaluation
and returning an errorFormulaResult. Outside range
contexts every error short-circuits.
A1 keys. The cellId argument is the A1 reference string
("A1", "BC42") produced from the AST's CellRef via
cellRefToA1. The host is responsible for any further
translation into its backing-store identifier.
Evaluation-time host abstraction for the formula evaluator.
Remarks
The host is the only thing evaluate talks to. Every cell read goes through FormulaHost.readNumber; the evaluator itself contains no graph, no resolver, no coercion table. This is the public surface that the eventual Rust evaluator port must satisfy — both implementations consume the same Ast and produce the same FormulaResult, differing only in how the host resolves cell IDs to numeric values.
Error semantics. A host may return a FormulaError for any failure: missing cell, non-numeric upstream value, propagated upstream error, or backing-store-specific I/O failure. The evaluator treats
unresolved-refspecially inside range aggregations (skipped silently to match spreadsheet idiom) and surfaces every other error category by short-circuiting evaluation and returning anerrorFormulaResult. Outside range contexts every error short-circuits.A1 keys. The
cellIdargument is the A1 reference string ("A1","BC42") produced from the AST's CellRef via cellRefToA1. The host is responsible for any further translation into its backing-store identifier.