Summary
Add named markdown tables and a first-class Array type to CalcMark, enabling tabular data to serve as a computation source.
Canonical use case: Consulting SOW where a table of roles, rates, and headcount computes line totals and grand totals — no data duplication between tables and calc blocks.
Key capabilities
- Directive-based table naming:
<!-- table: rates (role, rate, hc) -->
- Dot-access syntax for column arrays:
rates.rate, rates.hc
- Element-wise arithmetic:
rates.rate * rates.hc
- Aggregate functions on arrays:
sum(), avg(), min(), max(), count()
- Array interpolation in table cells:
{{line_costs}} per row
Documents
- Requirements:
docs/brainstorms/2026-04-06-named-tables-and-arrays-requirements.md
- Plan:
docs/plans/2026-04-06-003-feat-named-tables-and-arrays-plan.md
Plan structure (10 units, 6 phases)
- Type Foundation: Array + Table types
- Syntax: AST node, lexer DOT generalization, parser MemberAccess + new function tokens
- Document Pipeline: Table directive parsing + extraction from TextBlocks
- Semantic + Interpreter: MemberAccess eval, element-wise ops, aggregate functions
- Display + Interpolation: Array formatting, array-in-table-cell interpolation, JSON output
- Integration: Classifier, feature registry, golden tests
Summary
Add named markdown tables and a first-class Array type to CalcMark, enabling tabular data to serve as a computation source.
Canonical use case: Consulting SOW where a table of roles, rates, and headcount computes line totals and grand totals — no data duplication between tables and calc blocks.
Key capabilities
<!-- table: rates (role, rate, hc) -->rates.rate,rates.hcrates.rate * rates.hcsum(),avg(),min(),max(),count(){{line_costs}}per rowDocuments
docs/brainstorms/2026-04-06-named-tables-and-arrays-requirements.mddocs/plans/2026-04-06-003-feat-named-tables-and-arrays-plan.mdPlan structure (10 units, 6 phases)