Atom

binary.view()

Borrows a packed slice.

Signature

binary.view(sequence, range)

Parameters

Packed sequence and ordered, in-bounds half-open range.

Returns

Packed view.

Behavior

Shares storage with the source and follows relocation during growth. Removal invalidates prior views.

Errors

Wrong receiver, out-of-bounds range or invalidated view.

Example

Atom
use binary
a = create(u8, 4)
b = binary.view(a, 1..3)
b[0] = 7
assert(a[1] == 7)