Add required array element constraints

This commit is contained in:
2026-08-11 17:24:04 +09:00
parent 5a05da6fe4
commit 46b2b3b1b6
35 changed files with 6328 additions and 5042 deletions
+5 -1
View File
@@ -17,7 +17,7 @@ let / function env
```
Module top-level bindings shadow prelude bindings.
Primitive type names such as `String`, `Int`, `Float`, `Bool`, and `Array` are handled before environment lookup, so they are reserved and cannot be shadowed by host bindings.
Primitive type names such as `String`, `Int`, `Float`, and `Bool` are handled before environment lookup, so they are reserved and cannot be shadowed by host bindings.
## Global bindings
@@ -59,12 +59,16 @@ HostValue =
Float
Bool
Array(Vec<HostValue>)
ArrayConstraint { item, constraints, default }
Object(Vec<HostField>)
Abstract { constraints, default }
```
When a host value is bound, the engine internalizes it into `RuntimeValue` and allocates value thunks for object fields, array items, and defaults.
`HostValue::array_of(item)` builds an array constraint with a required element schema.
There is no host API for an unconstrained abstract array.
## Abstract host objects
A host-provided schema object is represented as a concrete object structure whose fields may contain abstract values.