Expand description
Shared implementations of the mutable-array accessors.
Both the stdlib natives (sema-stdlib/src/mutable.rs) and the VM’s
MutArrGet / MutArrSet intrinsic opcodes (sema-vm/src/vm.rs) dispatch
into these, so the two paths raise byte-identical errors and can never
drift apart semantically.
Functions§
- mutable_
array_ get mutable-array/get: indexed read.defaultis the optional third argument — returned on an out-of-bounds index instead of erroring. Type and index errors are raised regardless of the default.- mutable_
array_ set mutable-array/set!: indexed write into an existing slot. Takesvalby move so a caller that owns the value (the VM’sMutArrSetarm) pays no clone. The Sema-level contract returns the array itself — the caller hands back its own array handle afterOk(()).