This commit is contained in:
2026-06-16 00:45:10 +09:00
commit 5d6a03b74f
32 changed files with 1443 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
# Bool
`Bool` は真偽値を表す primitive type constraint である。
## 例
```n
enable = Bool default true;
disable = Bool default false;
```
## リテラル
`Bool` が受け入れるリテラルは以下である。
```n
true
false
```
+15
View File
@@ -0,0 +1,15 @@
# Float
`Float` は浮動小数値を表す primitive type constraint である。
## 例
```n
ratio = Float;
threshold = Float default 0.5;
```
## 未確定事項
`Int``Float` の暗黙変換を許可するかは未確定である。
軽量実装では、両者を明確に分ける方が単純である。
+17
View File
@@ -0,0 +1,17 @@
# Value
この章では、言語が扱う値の分類を定義する。
primitive type は、通常のデータ値ではなく、値が満たすべき組み込み制約として扱う。
```n
name = String;
retry = Int default 3;
ratio = Float;
enable = Bool default true;
```
現在の primitive type は `String``Int``Float``Bool` である。
各型の個別仕様へのリンクは [Manual Index](../../index.md) に集約する。
primitive type と制約合成の詳細は [制約と default](../constraints-and-defaults.md) も参照する。
+18
View File
@@ -0,0 +1,18 @@
# Int
`Int` は整数値を表す primitive type constraint である。
## 例
```n
retry = Int default 3;
port = Int & >= 1 & <= 65535;
```
## 制約合成
数値比較制約と合成できる。
```n
NarrowedPort = Int & >= 1 & <= 65535 & > 443;
```
+20
View File
@@ -0,0 +1,20 @@
# String
`String` は文字列値を表す primitive type constraint である。
## 例
```n
name = String;
greeting = String default "hello";
```
## 制約合成
`String` は文字列制約と合成できる。
```n
message = String & /Hello! .*/;
```
正規表現制約を必須機能にするかは未確定である。