@cella-lang/cpp 0.1.202610072338 → 0.1.202610080149
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGES.md +19 -0
- package/cpp.cell +0 -0
- package/index.json +483 -319
- package/package.json +5 -5
package/CHANGES.md
CHANGED
|
@@ -5,6 +5,12 @@
|
|
|
5
5
|
|
|
6
6
|
## 2026-10-08
|
|
7
7
|
|
|
8
|
+
### 檢查器
|
|
9
|
+
|
|
10
|
+
- 非遞迴、頂層 match 在參數上的定義,在 scrutinee 卡住時保持折疊(history 294)。存下來的項變小:這個套件從 6.6 MB 變成約 2 MB,載入更快。
|
|
11
|
+
- **雜湊改變**:許多定義的項因此改變,語意不變。請以 `index.json` 的新雜湊為準。
|
|
12
|
+
- `docs/stable-defs.json` 裡守的定義有 8 個改變(都是定理,計算用的定義不變):`cpp.isPropInRange`、`cpp.toInt_add`、`toInt_sub`、`toInt_mul`、`toInt_div`、`toInt_rem`、`toInt_neg`、`toInt_inj`。`IntN`、`add`、`div` 等運算本身的雜湊不變。
|
|
13
|
+
|
|
8
14
|
### 控制流
|
|
9
15
|
|
|
10
16
|
- **小步語意加了計數迴圈、函式呼叫、do-while、switch**。
|
|
@@ -29,6 +35,7 @@
|
|
|
29
35
|
- 兩邊都是整數照舊用 `cpp.addV` 這類。
|
|
30
36
|
- 結果型別的規則寫在 `cpp.arithT`。
|
|
31
37
|
- **`<cmath>`**:`cpp.fabs`、`ffloor`、`fceil`、`ftrunc`、`fround`(.5 離零)、`fmod`。結果都精確。
|
|
38
|
+
- **`pow(x, n)`(n 是整數)**:`cpp.fpowi x n`,正確捨入。指數不是整數的 `pow` 還沒有。
|
|
32
39
|
- **雜湊改變**:`cpp.fconvV`(改用另一種捨入算法,值不變;float/double 之間的大數轉換不再逾時)。
|
|
33
40
|
|
|
34
41
|
### 容器與字串
|
|
@@ -46,6 +53,18 @@
|
|
|
46
53
|
- `strFront`、`strBack`、`strPopBack`,前置條件 `cpp.strNonEmpty refl`;
|
|
47
54
|
- `strClear`、`strIsEmpty`。
|
|
48
55
|
|
|
56
|
+
### 迭代器與演算法(F440)
|
|
57
|
+
|
|
58
|
+
- vector/陣列的迭代器是位置:`cpp.itBegin`、`itEnd`、`itDeref a k (cpp.itDerefOk refl)`、`itMove a k d (cpp.itMoveOk refl)`、`itNext`、`itDiff`。
|
|
59
|
+
- 範圍 for:`cpp.forEachA a (cpp.allInit refl) (fun x => …)`、`forEachIdxA`(`T&` 版本,本體拿到位置)。
|
|
60
|
+
- `cpp.findA`、`countA`、`reverseA`、`minElementA`、`maxElementA`;`cpp.flowState d r` 取出敘述正常結束時的狀態。
|
|
61
|
+
- 迭代器失效不在模型內:修改容器之後請重新取迭代器。
|
|
62
|
+
|
|
63
|
+
### C 風格字串(F442)
|
|
64
|
+
|
|
65
|
+
- `cpp.cstrArr pl m "lit"`(`char s[] = "lit"`)、`strlenC`、`strcmpC`、`strcpyC`、`strcatC`、`coutCStr`、`ptrPlus`。
|
|
66
|
+
- 前置條件:讀 `cpp.cstrOk refl`(在配置內遇到 NUL、都已初始化);寫 `cpp.strcpyOk refl refl`、`cpp.strcatOk refl refl`(整段在配置內、不重疊)。
|
|
67
|
+
|
|
49
68
|
### 定理
|
|
50
69
|
|
|
51
70
|
- 記憶體(對任意記憶體成立):
|
package/cpp.cell
CHANGED
|
Binary file
|