From f5266fd00e1f8df7e76be9fe426a93ae9a643629 Mon Sep 17 00:00:00 2001 From: tiye Date: Thu, 29 Oct 2026 03:50:37 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8C=E6=AD=A5=20Arithmetic=20=E8=87=B3=20C?= =?UTF-8?q?alcit=200.32.0=20=E7=B1=BB=E5=9E=8B=E8=AF=AD=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/tests.yaml | 6 ++--- README.md | 6 ++--- calcit.cirru | 52 ++++++++++++++---------------------- deps.cirru | 2 +- package.json | 2 +- yarn.lock | 10 +++---- 6 files changed, 33 insertions(+), 45 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 6df3330..3cb12f8 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -23,7 +23,7 @@ jobs: run: corepack enable - uses: calcit-lang/setup-calcit@v1.5.0 with: - version: "0.31.0" + version: "0.32.0" tools: calcit,caps caps-version: "0.1.1" - name: Install dependencies @@ -35,12 +35,12 @@ jobs: - name: Check snapshot and public contracts run: | set -euo pipefail - test "$(calcit --version)" = "0.31.0" + test "$(calcit --version)" = "0.32.0" test ! -e compact.cirru test ! -e package.cirru calcit edit format if ! git diff --exit-code --quiet -- calcit.cirru; then - echo '::error file=calcit.cirru::Snapshot is not canonical. With Calcit 0.31.0, run calcit edit format and inspect definitions through calcit query def.' + echo '::error file=calcit.cirru::Snapshot is not canonical. With Calcit 0.32.0, run calcit edit format and inspect definitions through calcit query def.' exit 1 fi calcit --strict-types --warn-dyn-method --check-only --all-defs diff --git a/README.md b/README.md index 5fd93b8..18e2d0a 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,9 @@ Arithmetic 复数运算模块,使用 `[实部, 虚部]` 数字列表;不提供前端资源或服务部署。 -使用者影响:CLI 与 `@calcit/procs` 配对升级至正式 **0.31.0**,CI 使用同一版本。 +使用者影响:CLI 与 `@calcit/procs` 配对升级至正式 **0.32.0**,CI 使用同一版本。 使用者需重新安装依赖并重新生成 JavaScript;模块版本仍为 0.0.1,本 PR 不代表新 tag 或 npm 发布。 -本轮不改运算源码、公开 `List` 契约、列表长度约束或原八种运算断言。 +本轮通过官方 formatter 更新类型标注;运算逻辑、公开 `List` 契约、列表长度约束和原八种运算断言不变。 没有前端资源,不添加 COS/CDN 配置;保留原全部类型门禁与 native/JavaScript 回放。 ### Usages @@ -30,7 +30,7 @@ Functions: ### Workflow -需要配对的正式 Calcit / `@calcit/procs` 0.31.0、caps 0.1.1、Node.js 24 和 Yarn 4.18.0: +需要配对的正式 Calcit / `@calcit/procs` 0.32.0、caps 0.1.1、Node.js 24 和 Yarn 4.18.0: ```sh caps --ci --strict diff --git a/calcit.cirru b/calcit.cirru index 6d526ef..21c24be 100644 --- a/calcit.cirru +++ b/calcit.cirru @@ -19,16 +19,14 @@ y $ .unwrap $ nth p2 1 [] (+ a x) (+ b y) :examples $ [] - :schema $ :: 'Fn $ {} - :args $ [] (:: 'List 'Number) (:: 'List 'Number) - :return $ :: 'List 'Number + :schema $ quote $ Fn (List Number) (List Number) + -> $ List Number 'conjugate $ %{} 'CodeEntry (:doc |) :code $ quote $ defn conjugate (pair) assoc pair 1 $ negate $ .unwrap (nth pair 1) :examples $ [] - :schema $ :: 'Fn $ {} - :args $ [] $ :: 'List 'Number - :return $ :: 'List 'Number + :schema $ quote $ Fn (List Number) + -> $ List Number 'divide $ %{} 'CodeEntry (:doc |) :code $ quote $ defn divide (value base) "|complex number division, renamed since naming collision" let[] (x y) value $ let[] (a b) base $ let @@ -37,9 +35,8 @@ * inverted $ + (* x a) (* y b) * inverted $ - (* y a) (* x b) :examples $ [] - :schema $ :: 'Fn $ {} - :args $ [] (:: 'List 'Number) (:: 'List 'Number) - :return $ :: 'List 'Number + :schema $ quote $ Fn (List Number) (List Number) + -> $ List Number 'divide-by $ %{} 'CodeEntry (:doc |) :code $ quote $ defn divide-by (point x) [] @@ -50,9 +47,8 @@ .unwrap $ nth point $ dec (.len point) , x :examples $ [] - :schema $ :: 'Fn $ {} - :args $ [] (:: 'List 'Number) 'Number - :return $ :: 'List 'Number + :schema $ quote $ Fn (List Number) Number + -> $ List Number 'multiply $ %{} 'CodeEntry (:doc |) :code $ quote $ defn multiply (v1 v2) let @@ -64,25 +60,22 @@ - (* a x) (* b y) + (* a y) (* b x) :examples $ [] - :schema $ :: 'Fn $ {} - :args $ [] (:: 'List 'Number) (:: 'List 'Number) - :return $ :: 'List 'Number + :schema $ quote $ Fn (List Number) (List Number) + -> $ List Number 'polar-point $ %{} 'CodeEntry (:doc |) :code $ quote $ defn polar-point (angle r) [] * r $ cos angle * r $ sin angle :examples $ [] - :schema $ :: 'Fn $ {} - :args $ [] 'Number 'Number - :return $ :: 'List 'Number + :schema $ quote $ Fn Number Number + -> $ List Number 'scale $ %{} 'CodeEntry (:doc |) :code $ quote $ defn scale (pair v) map pair $ fn (x) (* v x) :examples $ [] - :schema $ :: 'Fn $ {} - :args $ [] (:: 'List 'Number) 'Number - :return $ :: 'List 'Number + :schema $ quote $ Fn (List Number) Number + -> $ List Number 'subtract $ %{} 'CodeEntry (:doc |) :code $ quote $ defn subtract (v1 v2) let @@ -92,9 +85,8 @@ y $ .unwrap $ nth v2 1 [] (- a x) (- b y) :examples $ [] - :schema $ :: 'Fn $ {} - :args $ [] (:: 'List 'Number) (:: 'List 'Number) - :return $ :: 'List 'Number + :schema $ quote $ Fn (List Number) (List Number) + -> $ List Number :ns $ %{} 'NsEntry (:doc |) :code $ quote $ ns arithmetic.complex 'arithmetic.test $ %{} 'FileEntry @@ -102,18 +94,15 @@ 'main! $ %{} 'CodeEntry (:doc |) :code $ quote $ defn main! () (run-tests) :examples $ [] - :schema $ :: 'Fn $ {} (:return 'Unit) - :args $ [] + :schema $ quote $ Fn (-> Unit) 'reload! $ %{} 'CodeEntry (:doc |) :code $ quote $ defn reload! () (run-tests) :examples $ [] - :schema $ :: 'Fn $ {} (:return 'Unit) - :args $ [] + :schema $ quote $ Fn (-> Unit) 'run-tests $ %{} 'CodeEntry (:doc |) :code $ quote $ defn run-tests () (test-basic) :examples $ [] - :schema $ :: 'Fn $ {} (:return 'Unit) - :args $ [] + :schema $ quote $ Fn (-> Unit) 'test-basic $ %{} 'CodeEntry (:doc |) :code $ quote $ defn test-basic () assert= ([] 3 5) @@ -132,8 +121,7 @@ 2d/divide-by ([] 3 6) 3 assert= ([] 2 0) (2d/polar-point 0 2) :examples $ [] - :schema $ :: 'Fn $ {} (:return 'Unit) - :args $ [] + :schema $ quote $ Fn (-> Unit) :tests $ [] $ %{} 'TestEntry (:name |complex-operations) :code $ quote $ test-basic :tags $ #{} :unit diff --git a/deps.cirru b/deps.cirru index cd0d79e..58d526d 100644 --- a/deps.cirru +++ b/deps.cirru @@ -1,3 +1,3 @@ -{} (:calcit-version |0.31.0) +{} (:calcit-version |0.32.0) :version |0.0.1 :dependencies $ {} diff --git a/package.json b/package.json index 3ade675..838af5c 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "version": "0.0.1", "dependencies": { - "@calcit/procs": "0.31.0" + "@calcit/procs": "0.32.0" }, "scripts": { "compile": "calcit js", diff --git a/yarn.lock b/yarn.lock index 3164e4a..2840727 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12,15 +12,15 @@ __metadata: languageName: node linkType: hard -"@calcit/procs@npm:0.31.0": - version: 0.31.0 - resolution: "@calcit/procs@npm:0.31.0" +"@calcit/procs@npm:0.32.0": + version: 0.32.0 + resolution: "@calcit/procs@npm:0.32.0" dependencies: "@calcit/finger-vec": "npm:0.1.1" "@calcit/ternary-tree": "npm:0.0.26" "@cirru/parser.ts": "npm:0.0.10" "@cirru/writer.ts": "npm:^0.1.9" - checksum: 10c0/daa73d722acd302be00f5f83eb91f742025a5323fac01b84222bed0fffef688761c1285637f9d672b74c2b1bb4513b170d4b5dfcc51bd65f1396390bd526ac77 + checksum: 10c0/99e58a7b15f2e8216df8e15240a5661b65ae03e5206f01504ca738221fec89077dfceeb94372606bf47c30275f98971a9719377299b7576abd2778f350f47b9a languageName: node linkType: hard @@ -49,6 +49,6 @@ __metadata: version: 0.0.0-use.local resolution: "root-workspace-0b6124@workspace:." dependencies: - "@calcit/procs": "npm:0.31.0" + "@calcit/procs": "npm:0.32.0" languageName: unknown linkType: soft