# bin/set-u8 Return a copy of `$bytes` with an unsigned byte written at `offset`. Byte strings are immutable — the original `$bytes` is unchanged. ## Syntax
[bin/set-u8 $bytes $offset $value]
## Parameters - `$bytes` — byte string to copy and write into - `$offset` — 0-based byte offset - `$value` — value to write; clamped to 0–255 and truncated toward zero ## Examples
def buf [bin/set-u8 [bin/zeros 1] 0 200]
[bin/u8-at $buf 0] # → 200
[bin/u8-at $buf 0] # → 200
## Returns New byte string. A negative or out-of-bounds offset returns `%Err{:message}`. ## See Also `bin/u8-at`, `bin/set-bytes`, `bin/bytes`