cli: add bounded std copy/search and checked arithmetic
This commit is contained in:
36 files changed
+1533
-7
No files matched your search
@@ -218,3 +218,9 @@ Found while testing `std.bytes`: the frontend rejects `b""` with `E7006` (“an
|
||||
A plain integer cannot distinguish a decoded zero from a short input. A trap on malformed protocol input is not a recoverable API, and a boolean plus mutable out-parameter leaves an invalid/stale output for callers to track.
|
||||
|
||||
**Resolved in the endian work branch:** spec 16 §2.3 defines width-specific read result enums and one write result enum. Spec 15 §13 defines fully qualified standard enum type names, constructors and patterns using existing AIR enum semantics. RFC 0017 records the proposal. General modules, imported struct literals, generics and a must-use result rule remain outside this change.
|
||||
|
||||
## Q-029 — Bounded byte copy/search/split and recoverable arithmetic surface
|
||||
|
||||
Short destination capacity needs explicit failure without partial mutation. A substring search's empty needle can match the end of empty data, so the existing single-byte length sentinel cannot unambiguously encode all outcomes. A returned split pair would hold borrows inside an aggregate before that source/lifetime surface is available. Arithmetic operators currently either trap or wrap; buffer sizing needs a recoverable overflow result.
|
||||
|
||||
**Resolved in the STD-1b branch:** spec 16 §2.4 reuses `WriteResult` for copy, adds `FindResult` for substring search, and composes splitting from explicit caller-owned slices. Spec 16 §2.1.1 adds checked add/sub/mul for u64 and target-width usize with ordinary result enums. Wrapping stays with existing operators. No new borrowed aggregate, generic type, AIR instruction or arithmetic mode is introduced. RFC 0018 records this API policy; its status remains Proposed until owner acceptance.
|
||||
Reference in new issue
Block a user