- Add stdlib/data/table.mq.md with select/filter/sort/append/set-cell/join/ group as value-returning .mq.md functions over table.columns/row/cell. - Keep Value::Table logical semantics, GFM AST laziness and T0 physical storage unchanged; no new table builtin or HostOp (ADR-0032). - Add stdlib/tests/table.mq.md and a CLI test asserting shapes/order and input immutability; refresh the bundle digest. - Update architecture/status/spec/README/changelog and evidence. Gate: fmt, clippy -D warnings, 420 tests passed.
29 lines
702 B
Markdown
29 lines
702 B
Markdown
---
|
|
import:
|
|
table: "std:data/table"
|
|
---
|
|
|
|
## main
|
|
|
|
**数据 = 表(["名称", "分数"], [["甲", 87], ["乙", 92], ["丙", 71]])**
|
|
|
|
**选择 = table.选择列(数据, 1)**
|
|
|
|
**过滤 = table.过滤数值大于(数据, 1, 80)**
|
|
|
|
**排序 = table.排序(数据, 1)**
|
|
|
|
**追加 = table.追加行(数据, ["丁", 65])**
|
|
|
|
**设置 = table.设置单元格(数据, 0, 1, 99)**
|
|
|
|
**左 = 表(["名称", "分数"], [["甲", 87], ["乙", 92]])**
|
|
|
|
**右 = 表(["名称", "等级"], [["乙", "A"], ["甲", "B"]])**
|
|
|
|
**连接 = table.连接(左, 右, 0, 0)**
|
|
|
|
**分组 = table.分组(表(["类别", "值"], [["a", 1], ["b", 2], ["a", 3]]), 0, 1)**
|
|
|
|
*[选择, 过滤, 排序, 追加, 设置, 连接, 分组, 数据]*
|