docs: clarify static box method arity (implicit self) and plan fix in Phase 20.33; expand Bridge singleton injection spec; update checklist
This commit is contained in:
@ -132,6 +132,12 @@ static box Main {
|
||||
}
|
||||
```
|
||||
|
||||
注意(静的Boxのメソッド引数規約)
|
||||
- 静的Boxのメソッドは先頭に暗黙の `self`(= Singleton)が存在する。
|
||||
- つまり呼び出し側は `Main.main()` のように書いても、意味論上は `Main.main(self, ...)` の形になる。
|
||||
- VM/MIR/LLVM いずれのバックエンドでも、この規約に基づき引数個数(arity)を判定する。
|
||||
- 開発時のガイドライン: 静的Box内に定義する全メソッドは「先頭に `self` を取る」形で設計すること(将来の最適化や検証で一貫性を保つため)。
|
||||
|
||||
### **2.2 変数宣言**
|
||||
|
||||
#### **基本パターン**
|
||||
|
||||
Reference in New Issue
Block a user