Files
marqdo/examples/oa2026-showcase/invoice.mq.md
T
cflmy 9331af78e2 release(2.8.0): 合入 CHANGELOG/README/发版说明/skills prove 任务;CI 链接指向 doc/releases
- CHANGELOG.md:v2.8.0 条目(中英双语);
- README.md:版本行 2.7.1→2.8.0 + 愿景第 6 条(知识可证明);
- doc/releases/v2.8.0.md:双语发版说明(亮点/用法/已知限制);
- skills/marqdo-dev/index.mq.md:新增 prove 任务(路径/目录模式/
  require_lean/json;参数用 + 行声明升参,check 与 narrative-ratio 通过);
- 设计文档 §12.5 标记已合入;发版链接统一指向 doc/releases/v2.8.0.md。
2026-11-18 10:29:26 +08:00

1.9 KiB
Executable File
Raw Blame History

markup, title, description
markup title description
occlusion 一张订单,一份可执行的业务说明 叙述、数据、计算与断言共享同一个 .mq.md 源文件。

main

返回 类型 说明
result any None; execute this page's documented steps in order and observe their output or stated effects

这份文档不是代码旁边的说明,也不是说明里贴的代码。下表既是给人读的订单, 也是运行时直接使用的记录集合;下面的句子既解释业务规则,也参与计算。

订单 =

@ 客户 单价 数量 提前天数
1 青山实验室 120 3 10
2 远望中心 80 5 4
3 星尘工坊 200 1 14

逐行把「单价 × 数量」累加进小计。读者看到的是清单,机器执行的是同一张表。

We first 小计 = 0 for the next step.

  • [行](遍历 订单 为 行) We first 小计 = (小计 + (单价) * 数量))) for the next step.

业务约定写在叙述里:提前不少于七天,整单按九五折;否则原价。 本单最早提前 14 天。

We first 最早提前 = 14 for the next step.

  1. 最早提前 >= 7 We first 折后 = ((小计 * 95) / 100) for the next step.

We first 折后 = 小计 for the next step.

把结果、依据和判断一起写进文档。下面的断言如果跑不通,文档本身就是错的。

We first 含税 = ((折后 * 106) / 100) for the next step. We now [Display this step's result](> print text=小计). We now [Display this step's result](> print text=折后). We now [Display this step's result](> print text=含税).

  1. 含税 < 10000 We now [Display this step's result](> print text="within-cap").

We now [Display this step's result](> print text="over-cap").