Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

lib/typed-array.x

Packed typed Arrays generated from shared methods.

Primary API

FunctionSummary
Array.arraycharPacks values into a fresh array in source order.
Array.arraydblPacks values into a fresh array in source order.
Array.arrayfloatPacks values into a fresh array in source order.
Array.arrayintPacks values into a fresh array in source order.
Array.arraylongPacks values into a fresh array in source order.
Array.arrayshortPacks values into a fresh array in source order.
Array.arraystringPacks values into a fresh array in source order.
ArrayChar.arrayReturns a fresh ordinary Array containing boxed elements in source order.
ArrayChar.blockViews array as the same underlying Block storage.
ArrayChar.compareCompares packed Arrays lexicographically with the element family’s ordering.
ArrayChar.concatReturns a fresh array holding a followed by b.
ArrayChar.containsReports whether a native element equals value.
ArrayChar.copyReturns a fresh packed copy, or NULL for a null array.
ArrayChar.countReturns how many native elements equal value.
ArrayChar.equalReports elementwise native equality.
ArrayChar.findReturns the first index whose native element equals value, or -1.
ArrayChar.getindexReturns the element at raw index with no bounds or null check.
ArrayChar.getsliceReturns a fresh packed array for normalized [start:end:step].
ArrayChar.indexofReturns the same first-match index as ArrayChar.find.
ArrayChar.insertInserts value at normalized index and returns it.
ArrayChar.iterInitializes dest to lazily yield boxed elements in index order.
ArrayChar.newReturns a fresh empty packed array owned by the current Scope.
ArrayChar.postfixindexApplies ++ or -- at raw index and returns the previous value.
ArrayChar.pushAppends value and returns it.
ArrayChar.removeRemoves and returns the element at normalized index.
ArrayChar.remsliceRemoves normalized bounds [start:end] and returns a fresh packed array.
ArrayChar.reprReturns the readable packed-Array representation.
ArrayChar.reverseReverses array in place and returns that same array.
ArrayChar.setindexStores and returns value at raw index with no bounds or null check.
ArrayChar.setsliceReplaces normalized bounds [start:end] and returns array.
ArrayChar.shiftRemoves and returns the first element, shifting the remainder left.
ArrayChar.spliceReplaces remove_count values at normalized index and returns them.
ArrayChar.strReturns the packed-Array display String.
ArrayChar.take_lastRemoves and returns the last element.
ArrayChar.try_getReads normalized index into out and reports whether it exists.
ArrayChar.try_nextWrites the next native element, advances cursor, and returns one.
ArrayChar.try_take_lastRemoves the last element into out and returns one when present.
ArrayChar.unshiftInserts value at the front and returns it, shifting elements right.
ArrayChar.updateindexApplies integer op to raw element index and returns the stored value.
ArrayChar.varBoxes array with its registered packed-array tag without copying.
ArrayChar.write_reprAppends the readable packed-Array representation to out.
ArrayChar.write_strAppends the packed-Array display text to out.
ArrayDbl.arrayReturns a fresh ordinary Array containing boxed elements in source order.
ArrayDbl.blockViews array as the same underlying Block storage.
ArrayDbl.compareCompares packed Arrays lexicographically with the element family’s ordering.
ArrayDbl.concatReturns a fresh array holding a followed by b.
ArrayDbl.containsReports whether a native element equals value.
ArrayDbl.copyReturns a fresh packed copy, or NULL for a null array.
ArrayDbl.countReturns how many native elements equal value.
ArrayDbl.equalReports elementwise native equality.
ArrayDbl.findReturns the first index whose native element equals value, or -1.
ArrayDbl.getindexReturns the element at raw index with no bounds or null check.
ArrayDbl.getsliceReturns a fresh packed array for normalized [start:end:step].
ArrayDbl.indexofReturns the same first-match index as ArrayDbl.find.
ArrayDbl.insertInserts value at normalized index and returns it.
ArrayDbl.iterInitializes dest to lazily yield boxed elements in index order.
ArrayDbl.newReturns a fresh empty packed array owned by the current Scope.
ArrayDbl.postfixindexApplies ++ or -- at raw index and returns the previous value.
ArrayDbl.pushAppends value and returns it.
ArrayDbl.removeRemoves and returns the element at normalized index.
ArrayDbl.remsliceRemoves normalized bounds [start:end] and returns a fresh packed array.
ArrayDbl.reprReturns the readable packed-Array representation.
ArrayDbl.reverseReverses array in place and returns that same array.
ArrayDbl.setindexStores and returns value at raw index with no bounds or null check.
ArrayDbl.setsliceReplaces normalized bounds [start:end] and returns array.
ArrayDbl.shiftRemoves and returns the first element, shifting the remainder left.
ArrayDbl.spliceReplaces remove_count values at normalized index and returns them.
ArrayDbl.strReturns the packed-Array display String.
ArrayDbl.take_lastRemoves and returns the last element.
ArrayDbl.try_getReads normalized index into out and reports whether it exists.
ArrayDbl.try_nextWrites the next native element, advances cursor, and returns one.
ArrayDbl.try_take_lastRemoves the last element into out and returns one when present.
ArrayDbl.unshiftInserts value at the front and returns it, shifting elements right.
ArrayDbl.updateindexApplies a floating arithmetic op and returns the stored value.
ArrayDbl.varBoxes array with its registered packed-array tag without copying.
ArrayDbl.write_reprAppends the readable packed-Array representation to out.
ArrayDbl.write_strAppends the packed-Array display text to out.
ArrayFloat.arrayReturns a fresh ordinary Array containing boxed elements in source order.
ArrayFloat.blockViews array as the same underlying Block storage.
ArrayFloat.compareCompares packed Arrays lexicographically with the element family’s ordering.
ArrayFloat.concatReturns a fresh array holding a followed by b.
ArrayFloat.containsReports whether a native element equals value.
ArrayFloat.copyReturns a fresh packed copy, or NULL for a null array.
ArrayFloat.countReturns how many native elements equal value.
ArrayFloat.equalReports elementwise native equality.
ArrayFloat.findReturns the first index whose native element equals value, or -1.
ArrayFloat.getindexReturns the element at raw index with no bounds or null check.
ArrayFloat.getsliceReturns a fresh packed array for normalized [start:end:step].
ArrayFloat.indexofReturns the same first-match index as ArrayFloat.find.
ArrayFloat.insertInserts value at normalized index and returns it.
ArrayFloat.iterInitializes dest to lazily yield boxed elements in index order.
ArrayFloat.newReturns a fresh empty packed array owned by the current Scope.
ArrayFloat.postfixindexApplies ++ or -- at raw index and returns the previous value.
ArrayFloat.pushAppends value and returns it.
ArrayFloat.removeRemoves and returns the element at normalized index.
ArrayFloat.remsliceRemoves normalized bounds [start:end] and returns a fresh packed array.
ArrayFloat.reprReturns the readable packed-Array representation.
ArrayFloat.reverseReverses array in place and returns that same array.
ArrayFloat.setindexStores and returns value at raw index with no bounds or null check.
ArrayFloat.setsliceReplaces normalized bounds [start:end] and returns array.
ArrayFloat.shiftRemoves and returns the first element, shifting the remainder left.
ArrayFloat.spliceReplaces remove_count values at normalized index and returns them.
ArrayFloat.strReturns the packed-Array display String.
ArrayFloat.take_lastRemoves and returns the last element.
ArrayFloat.try_getReads normalized index into out and reports whether it exists.
ArrayFloat.try_nextWrites the next native element, advances cursor, and returns one.
ArrayFloat.try_take_lastRemoves the last element into out and returns one when present.
ArrayFloat.unshiftInserts value at the front and returns it, shifting elements right.
ArrayFloat.updateindexApplies a floating arithmetic op and returns the stored value.
ArrayFloat.varBoxes array with its registered packed-array tag without copying.
ArrayFloat.write_reprAppends the readable packed-Array representation to out.
ArrayFloat.write_strAppends the packed-Array display text to out.
ArrayInt.arrayReturns a fresh ordinary Array containing boxed elements in source order.
ArrayInt.blockViews array as the same underlying Block storage.
ArrayInt.compareCompares packed Arrays lexicographically with the element family’s ordering.
ArrayInt.concatReturns a fresh array holding a followed by b.
ArrayInt.containsReports whether a native element equals value.
ArrayInt.copyReturns a fresh packed copy, or NULL for a null array.
ArrayInt.countReturns how many native elements equal value.
ArrayInt.equalReports elementwise native equality.
ArrayInt.findReturns the first index whose native element equals value, or -1.
ArrayInt.getindexReturns the element at raw index with no bounds or null check.
ArrayInt.getsliceReturns a fresh packed array for normalized [start:end:step].
ArrayInt.indexofReturns the same first-match index as ArrayInt.find.
ArrayInt.insertInserts value at normalized index and returns it.
ArrayInt.iterInitializes dest to lazily yield boxed elements in index order.
ArrayInt.newReturns a fresh empty packed array owned by the current Scope.
ArrayInt.postfixindexApplies ++ or -- at raw index and returns the previous value.
ArrayInt.pushAppends value and returns it.
ArrayInt.removeRemoves and returns the element at normalized index.
ArrayInt.remsliceRemoves normalized bounds [start:end] and returns a fresh packed array.
ArrayInt.reprReturns the readable packed-Array representation.
ArrayInt.reverseReverses array in place and returns that same array.
ArrayInt.setindexStores and returns value at raw index with no bounds or null check.
ArrayInt.setsliceReplaces normalized bounds [start:end] and returns array.
ArrayInt.shiftRemoves and returns the first element, shifting the remainder left.
ArrayInt.spliceReplaces remove_count values at normalized index and returns them.
ArrayInt.strReturns the packed-Array display String.
ArrayInt.take_lastRemoves and returns the last element.
ArrayInt.try_getReads normalized index into out and reports whether it exists.
ArrayInt.try_nextWrites the next native element, advances cursor, and returns one.
ArrayInt.try_take_lastRemoves the last element into out and returns one when present.
ArrayInt.unshiftInserts value at the front and returns it, shifting elements right.
ArrayInt.updateindexApplies integer op to raw element index and returns the stored value.
ArrayInt.varBoxes array with its registered packed-array tag without copying.
ArrayInt.write_reprAppends the readable packed-Array representation to out.
ArrayInt.write_strAppends the packed-Array display text to out.
ArrayLong.arrayReturns a fresh ordinary Array containing boxed elements in source order.
ArrayLong.blockViews array as the same underlying Block storage.
ArrayLong.compareCompares packed Arrays lexicographically with the element family’s ordering.
ArrayLong.concatReturns a fresh array holding a followed by b.
ArrayLong.containsReports whether a native element equals value.
ArrayLong.copyReturns a fresh packed copy, or NULL for a null array.
ArrayLong.countReturns how many native elements equal value.
ArrayLong.equalReports elementwise native equality.
ArrayLong.findReturns the first index whose native element equals value, or -1.
ArrayLong.getindexReturns the element at raw index with no bounds or null check.
ArrayLong.getsliceReturns a fresh packed array for normalized [start:end:step].
ArrayLong.indexofReturns the same first-match index as ArrayLong.find.
ArrayLong.insertInserts value at normalized index and returns it.
ArrayLong.iterInitializes dest to lazily yield boxed elements in index order.
ArrayLong.newReturns a fresh empty packed array owned by the current Scope.
ArrayLong.postfixindexApplies ++ or -- at raw index and returns the previous value.
ArrayLong.pushAppends value and returns it.
ArrayLong.removeRemoves and returns the element at normalized index.
ArrayLong.remsliceRemoves normalized bounds [start:end] and returns a fresh packed array.
ArrayLong.reprReturns the readable packed-Array representation.
ArrayLong.reverseReverses array in place and returns that same array.
ArrayLong.setindexStores and returns value at raw index with no bounds or null check.
ArrayLong.setsliceReplaces normalized bounds [start:end] and returns array.
ArrayLong.shiftRemoves and returns the first element, shifting the remainder left.
ArrayLong.spliceReplaces remove_count values at normalized index and returns them.
ArrayLong.strReturns the packed-Array display String.
ArrayLong.take_lastRemoves and returns the last element.
ArrayLong.try_getReads normalized index into out and reports whether it exists.
ArrayLong.try_nextWrites the next native element, advances cursor, and returns one.
ArrayLong.try_take_lastRemoves the last element into out and returns one when present.
ArrayLong.unshiftInserts value at the front and returns it, shifting elements right.
ArrayLong.updateindexApplies integer op to raw element index and returns the stored value.
ArrayLong.varBoxes array with its registered packed-array tag without copying.
ArrayLong.write_reprAppends the readable packed-Array representation to out.
ArrayLong.write_strAppends the packed-Array display text to out.
ArrayShort.arrayReturns a fresh ordinary Array containing boxed elements in source order.
ArrayShort.blockViews array as the same underlying Block storage.
ArrayShort.compareCompares packed Arrays lexicographically with the element family’s ordering.
ArrayShort.concatReturns a fresh array holding a followed by b.
ArrayShort.containsReports whether a native element equals value.
ArrayShort.copyReturns a fresh packed copy, or NULL for a null array.
ArrayShort.countReturns how many native elements equal value.
ArrayShort.equalReports elementwise native equality.
ArrayShort.findReturns the first index whose native element equals value, or -1.
ArrayShort.getindexReturns the element at raw index with no bounds or null check.
ArrayShort.getsliceReturns a fresh packed array for normalized [start:end:step].
ArrayShort.indexofReturns the same first-match index as ArrayShort.find.
ArrayShort.insertInserts value at normalized index and returns it.
ArrayShort.iterInitializes dest to lazily yield boxed elements in index order.
ArrayShort.newReturns a fresh empty packed array owned by the current Scope.
ArrayShort.postfixindexApplies ++ or -- at raw index and returns the previous value.
ArrayShort.pushAppends value and returns it.
ArrayShort.removeRemoves and returns the element at normalized index.
ArrayShort.remsliceRemoves normalized bounds [start:end] and returns a fresh packed array.
ArrayShort.reprReturns the readable packed-Array representation.
ArrayShort.reverseReverses array in place and returns that same array.
ArrayShort.setindexStores and returns value at raw index with no bounds or null check.
ArrayShort.setsliceReplaces normalized bounds [start:end] and returns array.
ArrayShort.shiftRemoves and returns the first element, shifting the remainder left.
ArrayShort.spliceReplaces remove_count values at normalized index and returns them.
ArrayShort.strReturns the packed-Array display String.
ArrayShort.take_lastRemoves and returns the last element.
ArrayShort.try_getReads normalized index into out and reports whether it exists.
ArrayShort.try_nextWrites the next native element, advances cursor, and returns one.
ArrayShort.try_take_lastRemoves the last element into out and returns one when present.
ArrayShort.unshiftInserts value at the front and returns it, shifting elements right.
ArrayShort.updateindexApplies integer op to raw element index and returns the stored value.
ArrayShort.varBoxes array with its registered packed-array tag without copying.
ArrayShort.write_reprAppends the readable packed-Array representation to out.
ArrayShort.write_strAppends the packed-Array display text to out.
ArrayString.arrayReturns a fresh ordinary Array containing boxed elements in source order.
ArrayString.blockViews array as the same underlying Block storage.
ArrayString.compareCompares packed Arrays lexicographically with the element family’s ordering.
ArrayString.concatReturns a fresh array holding a followed by b.
ArrayString.containsReports whether a native element equals value.
ArrayString.copyReturns a fresh packed copy, or NULL for a null array.
ArrayString.countReturns how many native elements equal value.
ArrayString.equalReports elementwise native equality.
ArrayString.findReturns the first index whose native element equals value, or -1.
ArrayString.getindexReturns the element at raw index with no bounds or null check.
ArrayString.getsliceReturns a fresh packed array for normalized [start:end:step].
ArrayString.indexofReturns the same first-match index as ArrayString.find.
ArrayString.insertInserts value at normalized index and returns it.
ArrayString.iterInitializes dest to lazily yield boxed elements in index order.
ArrayString.newReturns a fresh empty packed array owned by the current Scope.
ArrayString.postfixindexRaises <bad-op> because String elements have no postfix operation.
ArrayString.pushAppends value and returns it.
ArrayString.removeRemoves and returns the element at normalized index.
ArrayString.remsliceRemoves normalized bounds [start:end] and returns a fresh packed array.
ArrayString.reprReturns the readable packed-Array representation.
ArrayString.reverseReverses array in place and returns that same array.
ArrayString.setindexStores and returns value at raw index with no bounds or null check.
ArrayString.setsliceReplaces normalized bounds [start:end] and returns array.
ArrayString.shiftRemoves and returns the first element, shifting the remainder left.
ArrayString.spliceReplaces remove_count values at normalized index and returns them.
ArrayString.strReturns the packed-Array display String.
ArrayString.take_lastRemoves and returns the last element.
ArrayString.try_getReads normalized index into out and reports whether it exists.
ArrayString.try_nextWrites the next native element, advances cursor, and returns one.
ArrayString.try_take_lastRemoves the last element into out and returns one when present.
ArrayString.unshiftInserts value at the front and returns it, shifting elements right.
ArrayString.updateindexConcatenates rhs onto the String at raw index and returns the stored canonical String.
ArrayString.varBoxes array with its registered packed-array tag without copying.
ArrayString.write_reprAppends the readable packed-Array representation to out.
ArrayString.write_strAppends the packed-Array display text to out.
Var.arraycharReturns the packed-array pointer carried by value.
Var.arraydblReturns the packed-array pointer carried by value.
Var.arrayfloatReturns the packed-array pointer carried by value.
Var.arrayintReturns the packed-array pointer carried by value.
Var.arraylongReturns the packed-array pointer carried by value.
Var.arrayshortReturns the packed-array pointer carried by value.
Var.arraystringReturns the packed-array pointer carried by value.

Array

Array.arraychar

ArrayChar Array.arraychar(Array values)

Packs values into a fresh array in source order. A null input returns NULL. Each element goes through its Var conversion; the source is unchanged and a failing conversion or allocation releases the partial result before transferring its cause.

Source: lib/typed-array.x:111

Array.arraydbl

ArrayDbl Array.arraydbl(Array values)

Packs values into a fresh array in source order. A null input returns NULL. Each element goes through its Var conversion; the source is unchanged and a failing conversion or allocation releases the partial result before transferring its cause.

Source: lib/typed-array.x:156

Array.arrayfloat

ArrayFloat Array.arrayfloat(Array values)

Packs values into a fresh array in source order. A null input returns NULL. Each element goes through its Var conversion; the source is unchanged and a failing conversion or allocation releases the partial result before transferring its cause.

Source: lib/typed-array.x:147

Array.arrayint

ArrayInt Array.arrayint(Array values)

Packs values into a fresh array in source order. A null input returns NULL. Each element goes through its Var conversion; the source is unchanged and a failing conversion or allocation releases the partial result before transferring its cause.

Source: lib/typed-array.x:129

Array.arraylong

ArrayLong Array.arraylong(Array values)

Packs values into a fresh array in source order. A null input returns NULL. Each element goes through its Var conversion; the source is unchanged and a failing conversion or allocation releases the partial result before transferring its cause.

Source: lib/typed-array.x:138

Array.arrayshort

ArrayShort Array.arrayshort(Array values)

Packs values into a fresh array in source order. A null input returns NULL. Each element goes through its Var conversion; the source is unchanged and a failing conversion or allocation releases the partial result before transferring its cause.

Source: lib/typed-array.x:120

Array.arraystring

ArrayString Array.arraystring(Array values)

Packs values into a fresh array in source order. A null input returns NULL. Each element goes through its Var conversion; the source is unchanged and a failing conversion or allocation releases the partial result before transferring its cause.

Source: lib/typed-array.x:165

ArrayChar

ArrayChar.array

Array ArrayChar.array(ArrayChar array)

Returns a fresh ordinary Array containing boxed elements in source order. A null input returns NULL. The typed Array and its storage are unchanged.

Raises: any cause from boxing or appending an element.

Source: lib/typed-array.x:107

ArrayChar.block

inline Block ArrayChar.block(ArrayChar array)

Views array as the same underlying Block storage.

Source: lib/typed-array.x:111

ArrayChar.compare

int ArrayChar.compare(ArrayChar a, ArrayChar b)

Compares packed Arrays lexicographically with the element family’s ordering. Identical handles compare equal and NULL sorts first.

Source: lib/typed-array.x:107

ArrayChar.concat

Self ArrayChar.concat(Self a, Self b)

Returns a fresh array holding a followed by b. Neither input is modified. A null a returns NULL, while a null b produces an independent copy of a.

Raises: <size-limit> or <alloc-fail> when the result cannot be represented or allocated.

Source: lib/typed-array.x:106

ArrayChar.contains

int ArrayChar.contains(ArrayChar array, char value)

Reports whether a native element equals value. The scan is linear. Raises: <size-limit> when the length exceeds the integer index domain.

Source: lib/typed-array.x:106

ArrayChar.copy

Self ArrayChar.copy(Self array)

Returns a fresh packed copy, or NULL for a null array. The result has independent mutable storage containing the same stored values.

Raises: <size-limit> or <alloc-fail> when the copy cannot be represented or allocated.

Source: lib/typed-array.x:106

ArrayChar.count

int ArrayChar.count(ArrayChar array, char value)

Returns how many native elements equal value. A null array returns zero; the scan is linear.

Raises: <size-limit> when the length exceeds the integer index domain.

Source: lib/typed-array.x:106

ArrayChar.equal

int ArrayChar.equal(ArrayChar a, ArrayChar b)

Reports elementwise native equality. Two null arrays compare equal; one null array or different lengths compare unequal.

Source: lib/typed-array.x:106

ArrayChar.find

int ArrayChar.find(ArrayChar array, char value)

Returns the first index whose native element equals value, or -1. A null array returns -1; the scan is linear and preserves source order.

Raises: <size-limit> when the length exceeds the integer index domain.

Source: lib/typed-array.x:106

ArrayChar.getindex

inline char ArrayChar.getindex(ArrayChar array, int index)

Returns the element at raw index with no bounds or null check. Negative indices are not normalized, and an invalid index has the same undefined behavior as indexing the equivalent C pointer.

Source: lib/typed-array.x:106

ArrayChar.getslice

Self ArrayChar.getslice(Self array, int start, int end, int step)

Returns a fresh packed array for normalized [start:end:step]. Negative bounds count from the end and a negative step walks backward.

Raises: <bad-arg> for a null array or zero step, <size-limit> outside the integer index domain, or <alloc-fail> on allocation failure.

Source: lib/typed-array.x:106

ArrayChar.indexof

int ArrayChar.indexof(ArrayChar array, char value)

Returns the same first-match index as ArrayChar.find.

Source: lib/typed-array.x:106

ArrayChar.insert

char ArrayChar.insert(ArrayChar array, int index, char value)

Inserts value at normalized index and returns it. The accepted range includes the position after the last element; negative indices are normalized against that wider range.

Raises: <bad-arg> for a null array or out-of-range index, <size-limit> at the integer index limit, or <alloc-fail> when storage cannot grow.

Source: lib/typed-array.x:106

ArrayChar.iter

Iter ArrayChar.iter(ArrayChar array, Iter dest)

Initializes dest to lazily yield boxed elements in index order. Returns dest, whose storage is caller-owned. The iterator borrows array and reads its current storage on each step, so both must remain live and mutation can change the remaining traversal. A null dest returns NULL. A null array, or one longer than the integer index domain, is exhausted. A boxed wide element is Scope-owned; retaining one after a pull requires its owning Scope to remain live.

Raises: any cause from boxing an element.

Source: lib/typed-array.x:111

ArrayChar.new

ArrayChar ArrayChar.new(void)

Returns a fresh empty packed array owned by the current Scope.

Raises: <alloc-fail> when storage cannot be allocated.

Source: lib/typed-array.x:106

ArrayChar.postfixindex

inline char ArrayChar.postfixindex(ArrayChar array, int index, Symbol op)

Applies ++ or -- at raw index and returns the previous value. The index has the unchecked C-pointer preconditions of bracket access.

Raises: <bad-op> for another operator. The failure does not return.

Source: lib/typed-array.x:110

ArrayChar.push

char ArrayChar.push(ArrayChar array, char value)

Appends value and returns it.

Raises: <bad-arg> for a null array, <size-limit> at the integer index limit, or <alloc-fail> when storage cannot grow.

Source: lib/typed-array.x:106

ArrayChar.remove

char ArrayChar.remove(ArrayChar array, int index)

Removes and returns the element at normalized index. Negative indices count from the end; following elements shift left.

Raises: <bad-arg> for a null array or out-of-range index, or <size-limit> when the length exceeds the integer index domain.

Source: lib/typed-array.x:106

ArrayChar.remslice

Self ArrayChar.remslice(Self array, int start, int end)

Removes normalized bounds [start:end] and returns a fresh packed array. Reversed bounds are swapped, and the removed values retain their order.

Raises: <bad-arg> for a null array, <size-limit> outside the integer index domain, or <alloc-fail> on allocation failure.

Source: lib/typed-array.x:106

ArrayChar.repr

String ArrayChar.repr(ArrayChar array)

Returns the readable packed-Array representation.

Source: lib/typed-array.x:107

ArrayChar.reverse

Self ArrayChar.reverse(Self array)

Reverses array in place and returns that same array. A null or one-element array is returned unchanged.

Source: lib/typed-array.x:106

ArrayChar.setindex

inline char ArrayChar.setindex(ArrayChar array, int index, char value)

Stores and returns value at raw index with no bounds or null check. Negative indices are not normalized, and an invalid index has the same undefined behavior as indexing the equivalent C pointer.

Source: lib/typed-array.x:106

ArrayChar.setslice

Self ArrayChar.setslice(Self array, int start, int end, Self values)

Replaces normalized bounds [start:end] and returns array. Reversed bounds are swapped; null values deletes the region. Passing array itself as values is supported and copies before mutation.

Raises: <bad-arg> for a null array, <size-limit> outside the integer index domain, or <alloc-fail> while copying self-aliased values or growing storage for the replacement. These failures leave array unchanged.

Source: lib/typed-array.x:106

ArrayChar.shift

char ArrayChar.shift(ArrayChar array)

Removes and returns the first element, shifting the remainder left. This operation is O(n).

Raises: <bad-arg> for a null or empty array, or <size-limit> when the length exceeds the integer index domain. These failures do not return.

Source: lib/typed-array.x:106

ArrayChar.splice

Self ArrayChar.splice(Self array, int index, int remove_count, Self values)

Replaces remove_count values at normalized index and returns them. The result is a fresh packed array. A nonpositive count removes nothing; null values performs deletion, and self-splicing is supported.

Raises: <bad-arg> for a null array, <size-limit> outside the integer index domain, or <alloc-fail> on allocation failure.

Source: lib/typed-array.x:106

ArrayChar.str

String ArrayChar.str(ArrayChar array)

Returns the packed-Array display String.

Source: lib/typed-array.x:107

ArrayChar.take_last

char ArrayChar.take_last(ArrayChar array)

Removes and returns the last element.

Raises: <bad-arg> for a null or empty array.

Source: lib/typed-array.x:106

ArrayChar.try_get

int ArrayChar.try_get(ArrayChar array, int index, char *out)

Reads normalized index into out and reports whether it exists. Negative indices count from the end. A null array, null out, or out-of-range index returns zero without writing; success returns one.

Raises: <size-limit> when the length exceeds the integer index domain.

Source: lib/typed-array.x:106

ArrayChar.try_next

int ArrayChar.try_next(ArrayChar array, int *cursor, char *out)

Writes the next native element, advances cursor, and returns one. Initialize the caller-owned cursor to zero. A null argument, negative cursor, exhaustion, or an array outside the integer index domain returns zero without changing cursor or out. Structural mutation invalidates the cursor.

Source: lib/typed-array.x:106

ArrayChar.try_take_last

int ArrayChar.try_take_last(ArrayChar array, char *out)

Removes the last element into out and returns one when present. A null or empty array, or null out, returns zero without writing or changing the array.

Source: lib/typed-array.x:106

ArrayChar.unshift

char ArrayChar.unshift(ArrayChar array, char value)

Inserts value at the front and returns it, shifting elements right. This operation is O(n).

Raises: <bad-arg> for a null array, <size-limit> at the integer index limit, or <alloc-fail> when storage cannot grow.

Source: lib/typed-array.x:106

ArrayChar.updateindex

inline char ArrayChar.updateindex( ArrayChar array, int index, Symbol op, char rhs)

Applies integer op to raw element index and returns the stored value. The index has the unchecked C-pointer preconditions of bracket access. Arithmetic follows the generated C operators, integer promotions, and result conversion. A failing operation leaves the element unchanged.

Raises: <div-zero>, <bad-shift>, or <bad-op> for its corresponding invalid operation.

Source: lib/typed-array.x:110

ArrayChar.var

inline Var ArrayChar.var(ArrayChar array)

Boxes array with its registered packed-array tag without copying. The boxed and typed values share the same mutable object identity.

Source: lib/typed-array.x:111

ArrayChar.write_repr

Buffer ArrayChar.write_repr(ArrayChar array, Buffer out)

Appends the readable packed-Array representation to out.

Source: lib/typed-array.x:107

ArrayChar.write_str

Buffer ArrayChar.write_str(ArrayChar array, Buffer out)

Appends the packed-Array display text to out.

Source: lib/typed-array.x:107

ArrayDbl

ArrayDbl.array

Array ArrayDbl.array(ArrayDbl array)

Returns a fresh ordinary Array containing boxed elements in source order. A null input returns NULL. The typed Array and its storage are unchanged.

Raises: any cause from boxing or appending an element.

Source: lib/typed-array.x:152

ArrayDbl.block

inline Block ArrayDbl.block(ArrayDbl array)

Views array as the same underlying Block storage.

Source: lib/typed-array.x:156

ArrayDbl.compare

int ArrayDbl.compare(ArrayDbl a, ArrayDbl b)

Compares packed Arrays lexicographically with the element family’s ordering. Identical handles compare equal and NULL sorts first.

Source: lib/typed-array.x:152

ArrayDbl.concat

Self ArrayDbl.concat(Self a, Self b)

Returns a fresh array holding a followed by b. Neither input is modified. A null a returns NULL, while a null b produces an independent copy of a.

Raises: <size-limit> or <alloc-fail> when the result cannot be represented or allocated.

Source: lib/typed-array.x:151

ArrayDbl.contains

int ArrayDbl.contains(ArrayDbl array, double value)

Reports whether a native element equals value. The scan is linear. Raises: <size-limit> when the length exceeds the integer index domain.

Source: lib/typed-array.x:151

ArrayDbl.copy

Self ArrayDbl.copy(Self array)

Returns a fresh packed copy, or NULL for a null array. The result has independent mutable storage containing the same stored values.

Raises: <size-limit> or <alloc-fail> when the copy cannot be represented or allocated.

Source: lib/typed-array.x:151

ArrayDbl.count

int ArrayDbl.count(ArrayDbl array, double value)

Returns how many native elements equal value. A null array returns zero; the scan is linear.

Raises: <size-limit> when the length exceeds the integer index domain.

Source: lib/typed-array.x:151

ArrayDbl.equal

int ArrayDbl.equal(ArrayDbl a, ArrayDbl b)

Reports elementwise native equality. Two null arrays compare equal; one null array or different lengths compare unequal.

Source: lib/typed-array.x:151

ArrayDbl.find

int ArrayDbl.find(ArrayDbl array, double value)

Returns the first index whose native element equals value, or -1. A null array returns -1; the scan is linear and preserves source order.

Raises: <size-limit> when the length exceeds the integer index domain.

Source: lib/typed-array.x:151

ArrayDbl.getindex

inline double ArrayDbl.getindex(ArrayDbl array, int index)

Returns the element at raw index with no bounds or null check. Negative indices are not normalized, and an invalid index has the same undefined behavior as indexing the equivalent C pointer.

Source: lib/typed-array.x:151

ArrayDbl.getslice

Self ArrayDbl.getslice(Self array, int start, int end, int step)

Returns a fresh packed array for normalized [start:end:step]. Negative bounds count from the end and a negative step walks backward.

Raises: <bad-arg> for a null array or zero step, <size-limit> outside the integer index domain, or <alloc-fail> on allocation failure.

Source: lib/typed-array.x:151

ArrayDbl.indexof

int ArrayDbl.indexof(ArrayDbl array, double value)

Returns the same first-match index as ArrayDbl.find.

Source: lib/typed-array.x:151

ArrayDbl.insert

double ArrayDbl.insert(ArrayDbl array, int index, double value)

Inserts value at normalized index and returns it. The accepted range includes the position after the last element; negative indices are normalized against that wider range.

Raises: <bad-arg> for a null array or out-of-range index, <size-limit> at the integer index limit, or <alloc-fail> when storage cannot grow.

Source: lib/typed-array.x:151

ArrayDbl.iter

Iter ArrayDbl.iter(ArrayDbl array, Iter dest)

Initializes dest to lazily yield boxed elements in index order. Returns dest, whose storage is caller-owned. The iterator borrows array and reads its current storage on each step, so both must remain live and mutation can change the remaining traversal. A null dest returns NULL. A null array, or one longer than the integer index domain, is exhausted. A boxed wide element is Scope-owned; retaining one after a pull requires its owning Scope to remain live.

Raises: any cause from boxing an element.

Source: lib/typed-array.x:156

ArrayDbl.new

ArrayDbl ArrayDbl.new(void)

Returns a fresh empty packed array owned by the current Scope.

Raises: <alloc-fail> when storage cannot be allocated.

Source: lib/typed-array.x:151

ArrayDbl.postfixindex

inline double ArrayDbl.postfixindex(ArrayDbl array, int index, Symbol op)

Applies ++ or -- at raw index and returns the previous value. The index has the unchecked C-pointer preconditions of bracket access.

Raises: <bad-op> for another operator. The failure does not return.

Source: lib/typed-array.x:155

ArrayDbl.push

double ArrayDbl.push(ArrayDbl array, double value)

Appends value and returns it.

Raises: <bad-arg> for a null array, <size-limit> at the integer index limit, or <alloc-fail> when storage cannot grow.

Source: lib/typed-array.x:151

ArrayDbl.remove

double ArrayDbl.remove(ArrayDbl array, int index)

Removes and returns the element at normalized index. Negative indices count from the end; following elements shift left.

Raises: <bad-arg> for a null array or out-of-range index, or <size-limit> when the length exceeds the integer index domain.

Source: lib/typed-array.x:151

ArrayDbl.remslice

Self ArrayDbl.remslice(Self array, int start, int end)

Removes normalized bounds [start:end] and returns a fresh packed array. Reversed bounds are swapped, and the removed values retain their order.

Raises: <bad-arg> for a null array, <size-limit> outside the integer index domain, or <alloc-fail> on allocation failure.

Source: lib/typed-array.x:151

ArrayDbl.repr

String ArrayDbl.repr(ArrayDbl array)

Returns the readable packed-Array representation.

Source: lib/typed-array.x:152

ArrayDbl.reverse

Self ArrayDbl.reverse(Self array)

Reverses array in place and returns that same array. A null or one-element array is returned unchanged.

Source: lib/typed-array.x:151

ArrayDbl.setindex

inline double ArrayDbl.setindex(ArrayDbl array, int index, double value)

Stores and returns value at raw index with no bounds or null check. Negative indices are not normalized, and an invalid index has the same undefined behavior as indexing the equivalent C pointer.

Source: lib/typed-array.x:151

ArrayDbl.setslice

Self ArrayDbl.setslice(Self array, int start, int end, Self values)

Replaces normalized bounds [start:end] and returns array. Reversed bounds are swapped; null values deletes the region. Passing array itself as values is supported and copies before mutation.

Raises: <bad-arg> for a null array, <size-limit> outside the integer index domain, or <alloc-fail> while copying self-aliased values or growing storage for the replacement. These failures leave array unchanged.

Source: lib/typed-array.x:151

ArrayDbl.shift

double ArrayDbl.shift(ArrayDbl array)

Removes and returns the first element, shifting the remainder left. This operation is O(n).

Raises: <bad-arg> for a null or empty array, or <size-limit> when the length exceeds the integer index domain. These failures do not return.

Source: lib/typed-array.x:151

ArrayDbl.splice

Self ArrayDbl.splice(Self array, int index, int remove_count, Self values)

Replaces remove_count values at normalized index and returns them. The result is a fresh packed array. A nonpositive count removes nothing; null values performs deletion, and self-splicing is supported.

Raises: <bad-arg> for a null array, <size-limit> outside the integer index domain, or <alloc-fail> on allocation failure.

Source: lib/typed-array.x:151

ArrayDbl.str

String ArrayDbl.str(ArrayDbl array)

Returns the packed-Array display String.

Source: lib/typed-array.x:152

ArrayDbl.take_last

double ArrayDbl.take_last(ArrayDbl array)

Removes and returns the last element.

Raises: <bad-arg> for a null or empty array.

Source: lib/typed-array.x:151

ArrayDbl.try_get

int ArrayDbl.try_get(ArrayDbl array, int index, double *out)

Reads normalized index into out and reports whether it exists. Negative indices count from the end. A null array, null out, or out-of-range index returns zero without writing; success returns one.

Raises: <size-limit> when the length exceeds the integer index domain.

Source: lib/typed-array.x:151

ArrayDbl.try_next

int ArrayDbl.try_next(ArrayDbl array, int *cursor, double *out)

Writes the next native element, advances cursor, and returns one. Initialize the caller-owned cursor to zero. A null argument, negative cursor, exhaustion, or an array outside the integer index domain returns zero without changing cursor or out. Structural mutation invalidates the cursor.

Source: lib/typed-array.x:151

ArrayDbl.try_take_last

int ArrayDbl.try_take_last(ArrayDbl array, double *out)

Removes the last element into out and returns one when present. A null or empty array, or null out, returns zero without writing or changing the array.

Source: lib/typed-array.x:151

ArrayDbl.unshift

double ArrayDbl.unshift(ArrayDbl array, double value)

Inserts value at the front and returns it, shifting elements right. This operation is O(n).

Raises: <bad-arg> for a null array, <size-limit> at the integer index limit, or <alloc-fail> when storage cannot grow.

Source: lib/typed-array.x:151

ArrayDbl.updateindex

inline double ArrayDbl.updateindex( ArrayDbl array, int index, Symbol op, double rhs)

Applies a floating arithmetic op and returns the stored value. The supported operators are +, -, *, and /; the raw index has the unchecked C-pointer preconditions of bracket access.

Raises: <bad-types> for another operator, before changing the element.

Source: lib/typed-array.x:155

ArrayDbl.var

inline Var ArrayDbl.var(ArrayDbl array)

Boxes array with its registered packed-array tag without copying. The boxed and typed values share the same mutable object identity.

Source: lib/typed-array.x:156

ArrayDbl.write_repr

Buffer ArrayDbl.write_repr(ArrayDbl array, Buffer out)

Appends the readable packed-Array representation to out.

Source: lib/typed-array.x:152

ArrayDbl.write_str

Buffer ArrayDbl.write_str(ArrayDbl array, Buffer out)

Appends the packed-Array display text to out.

Source: lib/typed-array.x:152

ArrayFloat

ArrayFloat.array

Array ArrayFloat.array(ArrayFloat array)

Returns a fresh ordinary Array containing boxed elements in source order. A null input returns NULL. The typed Array and its storage are unchanged.

Raises: any cause from boxing or appending an element.

Source: lib/typed-array.x:143

ArrayFloat.block

inline Block ArrayFloat.block(ArrayFloat array)

Views array as the same underlying Block storage.

Source: lib/typed-array.x:147

ArrayFloat.compare

int ArrayFloat.compare(ArrayFloat a, ArrayFloat b)

Compares packed Arrays lexicographically with the element family’s ordering. Identical handles compare equal and NULL sorts first.

Source: lib/typed-array.x:143

ArrayFloat.concat

Self ArrayFloat.concat(Self a, Self b)

Returns a fresh array holding a followed by b. Neither input is modified. A null a returns NULL, while a null b produces an independent copy of a.

Raises: <size-limit> or <alloc-fail> when the result cannot be represented or allocated.

Source: lib/typed-array.x:142

ArrayFloat.contains

int ArrayFloat.contains(ArrayFloat array, float value)

Reports whether a native element equals value. The scan is linear. Raises: <size-limit> when the length exceeds the integer index domain.

Source: lib/typed-array.x:142

ArrayFloat.copy

Self ArrayFloat.copy(Self array)

Returns a fresh packed copy, or NULL for a null array. The result has independent mutable storage containing the same stored values.

Raises: <size-limit> or <alloc-fail> when the copy cannot be represented or allocated.

Source: lib/typed-array.x:142

ArrayFloat.count

int ArrayFloat.count(ArrayFloat array, float value)

Returns how many native elements equal value. A null array returns zero; the scan is linear.

Raises: <size-limit> when the length exceeds the integer index domain.

Source: lib/typed-array.x:142

ArrayFloat.equal

int ArrayFloat.equal(ArrayFloat a, ArrayFloat b)

Reports elementwise native equality. Two null arrays compare equal; one null array or different lengths compare unequal.

Source: lib/typed-array.x:142

ArrayFloat.find

int ArrayFloat.find(ArrayFloat array, float value)

Returns the first index whose native element equals value, or -1. A null array returns -1; the scan is linear and preserves source order.

Raises: <size-limit> when the length exceeds the integer index domain.

Source: lib/typed-array.x:142

ArrayFloat.getindex

inline float ArrayFloat.getindex(ArrayFloat array, int index)

Returns the element at raw index with no bounds or null check. Negative indices are not normalized, and an invalid index has the same undefined behavior as indexing the equivalent C pointer.

Source: lib/typed-array.x:142

ArrayFloat.getslice

Self ArrayFloat.getslice(Self array, int start, int end, int step)

Returns a fresh packed array for normalized [start:end:step]. Negative bounds count from the end and a negative step walks backward.

Raises: <bad-arg> for a null array or zero step, <size-limit> outside the integer index domain, or <alloc-fail> on allocation failure.

Source: lib/typed-array.x:142

ArrayFloat.indexof

int ArrayFloat.indexof(ArrayFloat array, float value)

Returns the same first-match index as ArrayFloat.find.

Source: lib/typed-array.x:142

ArrayFloat.insert

float ArrayFloat.insert(ArrayFloat array, int index, float value)

Inserts value at normalized index and returns it. The accepted range includes the position after the last element; negative indices are normalized against that wider range.

Raises: <bad-arg> for a null array or out-of-range index, <size-limit> at the integer index limit, or <alloc-fail> when storage cannot grow.

Source: lib/typed-array.x:142

ArrayFloat.iter

Iter ArrayFloat.iter(ArrayFloat array, Iter dest)

Initializes dest to lazily yield boxed elements in index order. Returns dest, whose storage is caller-owned. The iterator borrows array and reads its current storage on each step, so both must remain live and mutation can change the remaining traversal. A null dest returns NULL. A null array, or one longer than the integer index domain, is exhausted. A boxed wide element is Scope-owned; retaining one after a pull requires its owning Scope to remain live.

Raises: any cause from boxing an element.

Source: lib/typed-array.x:147

ArrayFloat.new

ArrayFloat ArrayFloat.new(void)

Returns a fresh empty packed array owned by the current Scope.

Raises: <alloc-fail> when storage cannot be allocated.

Source: lib/typed-array.x:142

ArrayFloat.postfixindex

inline float ArrayFloat.postfixindex(ArrayFloat array, int index, Symbol op)

Applies ++ or -- at raw index and returns the previous value. The index has the unchecked C-pointer preconditions of bracket access.

Raises: <bad-op> for another operator. The failure does not return.

Source: lib/typed-array.x:146

ArrayFloat.push

float ArrayFloat.push(ArrayFloat array, float value)

Appends value and returns it.

Raises: <bad-arg> for a null array, <size-limit> at the integer index limit, or <alloc-fail> when storage cannot grow.

Source: lib/typed-array.x:142

ArrayFloat.remove

float ArrayFloat.remove(ArrayFloat array, int index)

Removes and returns the element at normalized index. Negative indices count from the end; following elements shift left.

Raises: <bad-arg> for a null array or out-of-range index, or <size-limit> when the length exceeds the integer index domain.

Source: lib/typed-array.x:142

ArrayFloat.remslice

Self ArrayFloat.remslice(Self array, int start, int end)

Removes normalized bounds [start:end] and returns a fresh packed array. Reversed bounds are swapped, and the removed values retain their order.

Raises: <bad-arg> for a null array, <size-limit> outside the integer index domain, or <alloc-fail> on allocation failure.

Source: lib/typed-array.x:142

ArrayFloat.repr

String ArrayFloat.repr(ArrayFloat array)

Returns the readable packed-Array representation.

Source: lib/typed-array.x:143

ArrayFloat.reverse

Self ArrayFloat.reverse(Self array)

Reverses array in place and returns that same array. A null or one-element array is returned unchanged.

Source: lib/typed-array.x:142

ArrayFloat.setindex

inline float ArrayFloat.setindex(ArrayFloat array, int index, float value)

Stores and returns value at raw index with no bounds or null check. Negative indices are not normalized, and an invalid index has the same undefined behavior as indexing the equivalent C pointer.

Source: lib/typed-array.x:142

ArrayFloat.setslice

Self ArrayFloat.setslice(Self array, int start, int end, Self values)

Replaces normalized bounds [start:end] and returns array. Reversed bounds are swapped; null values deletes the region. Passing array itself as values is supported and copies before mutation.

Raises: <bad-arg> for a null array, <size-limit> outside the integer index domain, or <alloc-fail> while copying self-aliased values or growing storage for the replacement. These failures leave array unchanged.

Source: lib/typed-array.x:142

ArrayFloat.shift

float ArrayFloat.shift(ArrayFloat array)

Removes and returns the first element, shifting the remainder left. This operation is O(n).

Raises: <bad-arg> for a null or empty array, or <size-limit> when the length exceeds the integer index domain. These failures do not return.

Source: lib/typed-array.x:142

ArrayFloat.splice

Self ArrayFloat.splice(Self array, int index, int remove_count, Self values)

Replaces remove_count values at normalized index and returns them. The result is a fresh packed array. A nonpositive count removes nothing; null values performs deletion, and self-splicing is supported.

Raises: <bad-arg> for a null array, <size-limit> outside the integer index domain, or <alloc-fail> on allocation failure.

Source: lib/typed-array.x:142

ArrayFloat.str

String ArrayFloat.str(ArrayFloat array)

Returns the packed-Array display String.

Source: lib/typed-array.x:143

ArrayFloat.take_last

float ArrayFloat.take_last(ArrayFloat array)

Removes and returns the last element.

Raises: <bad-arg> for a null or empty array.

Source: lib/typed-array.x:142

ArrayFloat.try_get

int ArrayFloat.try_get(ArrayFloat array, int index, float *out)

Reads normalized index into out and reports whether it exists. Negative indices count from the end. A null array, null out, or out-of-range index returns zero without writing; success returns one.

Raises: <size-limit> when the length exceeds the integer index domain.

Source: lib/typed-array.x:142

ArrayFloat.try_next

int ArrayFloat.try_next(ArrayFloat array, int *cursor, float *out)

Writes the next native element, advances cursor, and returns one. Initialize the caller-owned cursor to zero. A null argument, negative cursor, exhaustion, or an array outside the integer index domain returns zero without changing cursor or out. Structural mutation invalidates the cursor.

Source: lib/typed-array.x:142

ArrayFloat.try_take_last

int ArrayFloat.try_take_last(ArrayFloat array, float *out)

Removes the last element into out and returns one when present. A null or empty array, or null out, returns zero without writing or changing the array.

Source: lib/typed-array.x:142

ArrayFloat.unshift

float ArrayFloat.unshift(ArrayFloat array, float value)

Inserts value at the front and returns it, shifting elements right. This operation is O(n).

Raises: <bad-arg> for a null array, <size-limit> at the integer index limit, or <alloc-fail> when storage cannot grow.

Source: lib/typed-array.x:142

ArrayFloat.updateindex

inline float ArrayFloat.updateindex( ArrayFloat array, int index, Symbol op, float rhs)

Applies a floating arithmetic op and returns the stored value. The supported operators are +, -, *, and /; the raw index has the unchecked C-pointer preconditions of bracket access.

Raises: <bad-types> for another operator, before changing the element.

Source: lib/typed-array.x:146

ArrayFloat.var

inline Var ArrayFloat.var(ArrayFloat array)

Boxes array with its registered packed-array tag without copying. The boxed and typed values share the same mutable object identity.

Source: lib/typed-array.x:147

ArrayFloat.write_repr

Buffer ArrayFloat.write_repr(ArrayFloat array, Buffer out)

Appends the readable packed-Array representation to out.

Source: lib/typed-array.x:143

ArrayFloat.write_str

Buffer ArrayFloat.write_str(ArrayFloat array, Buffer out)

Appends the packed-Array display text to out.

Source: lib/typed-array.x:143

ArrayInt

ArrayInt.array

Array ArrayInt.array(ArrayInt array)

Returns a fresh ordinary Array containing boxed elements in source order. A null input returns NULL. The typed Array and its storage are unchanged.

Raises: any cause from boxing or appending an element.

Source: lib/typed-array.x:125

ArrayInt.block

inline Block ArrayInt.block(ArrayInt array)

Views array as the same underlying Block storage.

Source: lib/typed-array.x:129

ArrayInt.compare

int ArrayInt.compare(ArrayInt a, ArrayInt b)

Compares packed Arrays lexicographically with the element family’s ordering. Identical handles compare equal and NULL sorts first.

Source: lib/typed-array.x:125

ArrayInt.concat

Self ArrayInt.concat(Self a, Self b)

Returns a fresh array holding a followed by b. Neither input is modified. A null a returns NULL, while a null b produces an independent copy of a.

Raises: <size-limit> or <alloc-fail> when the result cannot be represented or allocated.

Source: lib/typed-array.x:124

ArrayInt.contains

int ArrayInt.contains(ArrayInt array, int value)

Reports whether a native element equals value. The scan is linear. Raises: <size-limit> when the length exceeds the integer index domain.

Source: lib/typed-array.x:124

ArrayInt.copy

Self ArrayInt.copy(Self array)

Returns a fresh packed copy, or NULL for a null array. The result has independent mutable storage containing the same stored values.

Raises: <size-limit> or <alloc-fail> when the copy cannot be represented or allocated.

Source: lib/typed-array.x:124

ArrayInt.count

int ArrayInt.count(ArrayInt array, int value)

Returns how many native elements equal value. A null array returns zero; the scan is linear.

Raises: <size-limit> when the length exceeds the integer index domain.

Source: lib/typed-array.x:124

ArrayInt.equal

int ArrayInt.equal(ArrayInt a, ArrayInt b)

Reports elementwise native equality. Two null arrays compare equal; one null array or different lengths compare unequal.

Source: lib/typed-array.x:124

ArrayInt.find

int ArrayInt.find(ArrayInt array, int value)

Returns the first index whose native element equals value, or -1. A null array returns -1; the scan is linear and preserves source order.

Raises: <size-limit> when the length exceeds the integer index domain.

Source: lib/typed-array.x:124

ArrayInt.getindex

inline int ArrayInt.getindex(ArrayInt array, int index)

Returns the element at raw index with no bounds or null check. Negative indices are not normalized, and an invalid index has the same undefined behavior as indexing the equivalent C pointer.

Source: lib/typed-array.x:124

ArrayInt.getslice

Self ArrayInt.getslice(Self array, int start, int end, int step)

Returns a fresh packed array for normalized [start:end:step]. Negative bounds count from the end and a negative step walks backward.

Raises: <bad-arg> for a null array or zero step, <size-limit> outside the integer index domain, or <alloc-fail> on allocation failure.

Source: lib/typed-array.x:124

ArrayInt.indexof

int ArrayInt.indexof(ArrayInt array, int value)

Returns the same first-match index as ArrayInt.find.

Source: lib/typed-array.x:124

ArrayInt.insert

int ArrayInt.insert(ArrayInt array, int index, int value)

Inserts value at normalized index and returns it. The accepted range includes the position after the last element; negative indices are normalized against that wider range.

Raises: <bad-arg> for a null array or out-of-range index, <size-limit> at the integer index limit, or <alloc-fail> when storage cannot grow.

Source: lib/typed-array.x:124

ArrayInt.iter

Iter ArrayInt.iter(ArrayInt array, Iter dest)

Initializes dest to lazily yield boxed elements in index order. Returns dest, whose storage is caller-owned. The iterator borrows array and reads its current storage on each step, so both must remain live and mutation can change the remaining traversal. A null dest returns NULL. A null array, or one longer than the integer index domain, is exhausted. A boxed wide element is Scope-owned; retaining one after a pull requires its owning Scope to remain live.

Raises: any cause from boxing an element.

Source: lib/typed-array.x:129

ArrayInt.new

ArrayInt ArrayInt.new(void)

Returns a fresh empty packed array owned by the current Scope.

Raises: <alloc-fail> when storage cannot be allocated.

Source: lib/typed-array.x:124

ArrayInt.postfixindex

inline int ArrayInt.postfixindex(ArrayInt array, int index, Symbol op)

Applies ++ or -- at raw index and returns the previous value. The index has the unchecked C-pointer preconditions of bracket access.

Raises: <bad-op> for another operator. The failure does not return.

Source: lib/typed-array.x:128

ArrayInt.push

int ArrayInt.push(ArrayInt array, int value)

Appends value and returns it.

Raises: <bad-arg> for a null array, <size-limit> at the integer index limit, or <alloc-fail> when storage cannot grow.

Source: lib/typed-array.x:124

ArrayInt.remove

int ArrayInt.remove(ArrayInt array, int index)

Removes and returns the element at normalized index. Negative indices count from the end; following elements shift left.

Raises: <bad-arg> for a null array or out-of-range index, or <size-limit> when the length exceeds the integer index domain.

Source: lib/typed-array.x:124

ArrayInt.remslice

Self ArrayInt.remslice(Self array, int start, int end)

Removes normalized bounds [start:end] and returns a fresh packed array. Reversed bounds are swapped, and the removed values retain their order.

Raises: <bad-arg> for a null array, <size-limit> outside the integer index domain, or <alloc-fail> on allocation failure.

Source: lib/typed-array.x:124

ArrayInt.repr

String ArrayInt.repr(ArrayInt array)

Returns the readable packed-Array representation.

Source: lib/typed-array.x:125

ArrayInt.reverse

Self ArrayInt.reverse(Self array)

Reverses array in place and returns that same array. A null or one-element array is returned unchanged.

Source: lib/typed-array.x:124

ArrayInt.setindex

inline int ArrayInt.setindex(ArrayInt array, int index, int value)

Stores and returns value at raw index with no bounds or null check. Negative indices are not normalized, and an invalid index has the same undefined behavior as indexing the equivalent C pointer.

Source: lib/typed-array.x:124

ArrayInt.setslice

Self ArrayInt.setslice(Self array, int start, int end, Self values)

Replaces normalized bounds [start:end] and returns array. Reversed bounds are swapped; null values deletes the region. Passing array itself as values is supported and copies before mutation.

Raises: <bad-arg> for a null array, <size-limit> outside the integer index domain, or <alloc-fail> while copying self-aliased values or growing storage for the replacement. These failures leave array unchanged.

Source: lib/typed-array.x:124

ArrayInt.shift

int ArrayInt.shift(ArrayInt array)

Removes and returns the first element, shifting the remainder left. This operation is O(n).

Raises: <bad-arg> for a null or empty array, or <size-limit> when the length exceeds the integer index domain. These failures do not return.

Source: lib/typed-array.x:124

ArrayInt.splice

Self ArrayInt.splice(Self array, int index, int remove_count, Self values)

Replaces remove_count values at normalized index and returns them. The result is a fresh packed array. A nonpositive count removes nothing; null values performs deletion, and self-splicing is supported.

Raises: <bad-arg> for a null array, <size-limit> outside the integer index domain, or <alloc-fail> on allocation failure.

Source: lib/typed-array.x:124

ArrayInt.str

String ArrayInt.str(ArrayInt array)

Returns the packed-Array display String.

Source: lib/typed-array.x:125

ArrayInt.take_last

int ArrayInt.take_last(ArrayInt array)

Removes and returns the last element.

Raises: <bad-arg> for a null or empty array.

Source: lib/typed-array.x:124

ArrayInt.try_get

int ArrayInt.try_get(ArrayInt array, int index, int *out)

Reads normalized index into out and reports whether it exists. Negative indices count from the end. A null array, null out, or out-of-range index returns zero without writing; success returns one.

Raises: <size-limit> when the length exceeds the integer index domain.

Source: lib/typed-array.x:124

ArrayInt.try_next

int ArrayInt.try_next(ArrayInt array, int *cursor, int *out)

Writes the next native element, advances cursor, and returns one. Initialize the caller-owned cursor to zero. A null argument, negative cursor, exhaustion, or an array outside the integer index domain returns zero without changing cursor or out. Structural mutation invalidates the cursor.

Source: lib/typed-array.x:124

ArrayInt.try_take_last

int ArrayInt.try_take_last(ArrayInt array, int *out)

Removes the last element into out and returns one when present. A null or empty array, or null out, returns zero without writing or changing the array.

Source: lib/typed-array.x:124

ArrayInt.unshift

int ArrayInt.unshift(ArrayInt array, int value)

Inserts value at the front and returns it, shifting elements right. This operation is O(n).

Raises: <bad-arg> for a null array, <size-limit> at the integer index limit, or <alloc-fail> when storage cannot grow.

Source: lib/typed-array.x:124

ArrayInt.updateindex

inline int ArrayInt.updateindex( ArrayInt array, int index, Symbol op, int rhs)

Applies integer op to raw element index and returns the stored value. The index has the unchecked C-pointer preconditions of bracket access. Arithmetic follows the generated C operators, integer promotions, and result conversion. A failing operation leaves the element unchanged.

Raises: <div-zero>, <bad-shift>, or <bad-op> for its corresponding invalid operation.

Source: lib/typed-array.x:128

ArrayInt.var

inline Var ArrayInt.var(ArrayInt array)

Boxes array with its registered packed-array tag without copying. The boxed and typed values share the same mutable object identity.

Source: lib/typed-array.x:129

ArrayInt.write_repr

Buffer ArrayInt.write_repr(ArrayInt array, Buffer out)

Appends the readable packed-Array representation to out.

Source: lib/typed-array.x:125

ArrayInt.write_str

Buffer ArrayInt.write_str(ArrayInt array, Buffer out)

Appends the packed-Array display text to out.

Source: lib/typed-array.x:125

ArrayLong

ArrayLong.array

Array ArrayLong.array(ArrayLong array)

Returns a fresh ordinary Array containing boxed elements in source order. A null input returns NULL. The typed Array and its storage are unchanged.

Raises: any cause from boxing or appending an element.

Source: lib/typed-array.x:134

ArrayLong.block

inline Block ArrayLong.block(ArrayLong array)

Views array as the same underlying Block storage.

Source: lib/typed-array.x:138

ArrayLong.compare

int ArrayLong.compare(ArrayLong a, ArrayLong b)

Compares packed Arrays lexicographically with the element family’s ordering. Identical handles compare equal and NULL sorts first.

Source: lib/typed-array.x:134

ArrayLong.concat

Self ArrayLong.concat(Self a, Self b)

Returns a fresh array holding a followed by b. Neither input is modified. A null a returns NULL, while a null b produces an independent copy of a.

Raises: <size-limit> or <alloc-fail> when the result cannot be represented or allocated.

Source: lib/typed-array.x:133

ArrayLong.contains

int ArrayLong.contains(ArrayLong array, long value)

Reports whether a native element equals value. The scan is linear. Raises: <size-limit> when the length exceeds the integer index domain.

Source: lib/typed-array.x:133

ArrayLong.copy

Self ArrayLong.copy(Self array)

Returns a fresh packed copy, or NULL for a null array. The result has independent mutable storage containing the same stored values.

Raises: <size-limit> or <alloc-fail> when the copy cannot be represented or allocated.

Source: lib/typed-array.x:133

ArrayLong.count

int ArrayLong.count(ArrayLong array, long value)

Returns how many native elements equal value. A null array returns zero; the scan is linear.

Raises: <size-limit> when the length exceeds the integer index domain.

Source: lib/typed-array.x:133

ArrayLong.equal

int ArrayLong.equal(ArrayLong a, ArrayLong b)

Reports elementwise native equality. Two null arrays compare equal; one null array or different lengths compare unequal.

Source: lib/typed-array.x:133

ArrayLong.find

int ArrayLong.find(ArrayLong array, long value)

Returns the first index whose native element equals value, or -1. A null array returns -1; the scan is linear and preserves source order.

Raises: <size-limit> when the length exceeds the integer index domain.

Source: lib/typed-array.x:133

ArrayLong.getindex

inline long ArrayLong.getindex(ArrayLong array, int index)

Returns the element at raw index with no bounds or null check. Negative indices are not normalized, and an invalid index has the same undefined behavior as indexing the equivalent C pointer.

Source: lib/typed-array.x:133

ArrayLong.getslice

Self ArrayLong.getslice(Self array, int start, int end, int step)

Returns a fresh packed array for normalized [start:end:step]. Negative bounds count from the end and a negative step walks backward.

Raises: <bad-arg> for a null array or zero step, <size-limit> outside the integer index domain, or <alloc-fail> on allocation failure.

Source: lib/typed-array.x:133

ArrayLong.indexof

int ArrayLong.indexof(ArrayLong array, long value)

Returns the same first-match index as ArrayLong.find.

Source: lib/typed-array.x:133

ArrayLong.insert

long ArrayLong.insert(ArrayLong array, int index, long value)

Inserts value at normalized index and returns it. The accepted range includes the position after the last element; negative indices are normalized against that wider range.

Raises: <bad-arg> for a null array or out-of-range index, <size-limit> at the integer index limit, or <alloc-fail> when storage cannot grow.

Source: lib/typed-array.x:133

ArrayLong.iter

Iter ArrayLong.iter(ArrayLong array, Iter dest)

Initializes dest to lazily yield boxed elements in index order. Returns dest, whose storage is caller-owned. The iterator borrows array and reads its current storage on each step, so both must remain live and mutation can change the remaining traversal. A null dest returns NULL. A null array, or one longer than the integer index domain, is exhausted. A boxed wide element is Scope-owned; retaining one after a pull requires its owning Scope to remain live.

Raises: any cause from boxing an element.

Source: lib/typed-array.x:138

ArrayLong.new

ArrayLong ArrayLong.new(void)

Returns a fresh empty packed array owned by the current Scope.

Raises: <alloc-fail> when storage cannot be allocated.

Source: lib/typed-array.x:133

ArrayLong.postfixindex

inline long ArrayLong.postfixindex(ArrayLong array, int index, Symbol op)

Applies ++ or -- at raw index and returns the previous value. The index has the unchecked C-pointer preconditions of bracket access.

Raises: <bad-op> for another operator. The failure does not return.

Source: lib/typed-array.x:137

ArrayLong.push

long ArrayLong.push(ArrayLong array, long value)

Appends value and returns it.

Raises: <bad-arg> for a null array, <size-limit> at the integer index limit, or <alloc-fail> when storage cannot grow.

Source: lib/typed-array.x:133

ArrayLong.remove

long ArrayLong.remove(ArrayLong array, int index)

Removes and returns the element at normalized index. Negative indices count from the end; following elements shift left.

Raises: <bad-arg> for a null array or out-of-range index, or <size-limit> when the length exceeds the integer index domain.

Source: lib/typed-array.x:133

ArrayLong.remslice

Self ArrayLong.remslice(Self array, int start, int end)

Removes normalized bounds [start:end] and returns a fresh packed array. Reversed bounds are swapped, and the removed values retain their order.

Raises: <bad-arg> for a null array, <size-limit> outside the integer index domain, or <alloc-fail> on allocation failure.

Source: lib/typed-array.x:133

ArrayLong.repr

String ArrayLong.repr(ArrayLong array)

Returns the readable packed-Array representation.

Source: lib/typed-array.x:134

ArrayLong.reverse

Self ArrayLong.reverse(Self array)

Reverses array in place and returns that same array. A null or one-element array is returned unchanged.

Source: lib/typed-array.x:133

ArrayLong.setindex

inline long ArrayLong.setindex(ArrayLong array, int index, long value)

Stores and returns value at raw index with no bounds or null check. Negative indices are not normalized, and an invalid index has the same undefined behavior as indexing the equivalent C pointer.

Source: lib/typed-array.x:133

ArrayLong.setslice

Self ArrayLong.setslice(Self array, int start, int end, Self values)

Replaces normalized bounds [start:end] and returns array. Reversed bounds are swapped; null values deletes the region. Passing array itself as values is supported and copies before mutation.

Raises: <bad-arg> for a null array, <size-limit> outside the integer index domain, or <alloc-fail> while copying self-aliased values or growing storage for the replacement. These failures leave array unchanged.

Source: lib/typed-array.x:133

ArrayLong.shift

long ArrayLong.shift(ArrayLong array)

Removes and returns the first element, shifting the remainder left. This operation is O(n).

Raises: <bad-arg> for a null or empty array, or <size-limit> when the length exceeds the integer index domain. These failures do not return.

Source: lib/typed-array.x:133

ArrayLong.splice

Self ArrayLong.splice(Self array, int index, int remove_count, Self values)

Replaces remove_count values at normalized index and returns them. The result is a fresh packed array. A nonpositive count removes nothing; null values performs deletion, and self-splicing is supported.

Raises: <bad-arg> for a null array, <size-limit> outside the integer index domain, or <alloc-fail> on allocation failure.

Source: lib/typed-array.x:133

ArrayLong.str

String ArrayLong.str(ArrayLong array)

Returns the packed-Array display String.

Source: lib/typed-array.x:134

ArrayLong.take_last

long ArrayLong.take_last(ArrayLong array)

Removes and returns the last element.

Raises: <bad-arg> for a null or empty array.

Source: lib/typed-array.x:133

ArrayLong.try_get

int ArrayLong.try_get(ArrayLong array, int index, long *out)

Reads normalized index into out and reports whether it exists. Negative indices count from the end. A null array, null out, or out-of-range index returns zero without writing; success returns one.

Raises: <size-limit> when the length exceeds the integer index domain.

Source: lib/typed-array.x:133

ArrayLong.try_next

int ArrayLong.try_next(ArrayLong array, int *cursor, long *out)

Writes the next native element, advances cursor, and returns one. Initialize the caller-owned cursor to zero. A null argument, negative cursor, exhaustion, or an array outside the integer index domain returns zero without changing cursor or out. Structural mutation invalidates the cursor.

Source: lib/typed-array.x:133

ArrayLong.try_take_last

int ArrayLong.try_take_last(ArrayLong array, long *out)

Removes the last element into out and returns one when present. A null or empty array, or null out, returns zero without writing or changing the array.

Source: lib/typed-array.x:133

ArrayLong.unshift

long ArrayLong.unshift(ArrayLong array, long value)

Inserts value at the front and returns it, shifting elements right. This operation is O(n).

Raises: <bad-arg> for a null array, <size-limit> at the integer index limit, or <alloc-fail> when storage cannot grow.

Source: lib/typed-array.x:133

ArrayLong.updateindex

inline long ArrayLong.updateindex( ArrayLong array, int index, Symbol op, long rhs)

Applies integer op to raw element index and returns the stored value. The index has the unchecked C-pointer preconditions of bracket access. Arithmetic follows the generated C operators, integer promotions, and result conversion. A failing operation leaves the element unchanged.

Raises: <div-zero>, <bad-shift>, or <bad-op> for its corresponding invalid operation.

Source: lib/typed-array.x:137

ArrayLong.var

inline Var ArrayLong.var(ArrayLong array)

Boxes array with its registered packed-array tag without copying. The boxed and typed values share the same mutable object identity.

Source: lib/typed-array.x:138

ArrayLong.write_repr

Buffer ArrayLong.write_repr(ArrayLong array, Buffer out)

Appends the readable packed-Array representation to out.

Source: lib/typed-array.x:134

ArrayLong.write_str

Buffer ArrayLong.write_str(ArrayLong array, Buffer out)

Appends the packed-Array display text to out.

Source: lib/typed-array.x:134

ArrayShort

ArrayShort.array

Array ArrayShort.array(ArrayShort array)

Returns a fresh ordinary Array containing boxed elements in source order. A null input returns NULL. The typed Array and its storage are unchanged.

Raises: any cause from boxing or appending an element.

Source: lib/typed-array.x:116

ArrayShort.block

inline Block ArrayShort.block(ArrayShort array)

Views array as the same underlying Block storage.

Source: lib/typed-array.x:120

ArrayShort.compare

int ArrayShort.compare(ArrayShort a, ArrayShort b)

Compares packed Arrays lexicographically with the element family’s ordering. Identical handles compare equal and NULL sorts first.

Source: lib/typed-array.x:116

ArrayShort.concat

Self ArrayShort.concat(Self a, Self b)

Returns a fresh array holding a followed by b. Neither input is modified. A null a returns NULL, while a null b produces an independent copy of a.

Raises: <size-limit> or <alloc-fail> when the result cannot be represented or allocated.

Source: lib/typed-array.x:115

ArrayShort.contains

int ArrayShort.contains(ArrayShort array, short value)

Reports whether a native element equals value. The scan is linear. Raises: <size-limit> when the length exceeds the integer index domain.

Source: lib/typed-array.x:115

ArrayShort.copy

Self ArrayShort.copy(Self array)

Returns a fresh packed copy, or NULL for a null array. The result has independent mutable storage containing the same stored values.

Raises: <size-limit> or <alloc-fail> when the copy cannot be represented or allocated.

Source: lib/typed-array.x:115

ArrayShort.count

int ArrayShort.count(ArrayShort array, short value)

Returns how many native elements equal value. A null array returns zero; the scan is linear.

Raises: <size-limit> when the length exceeds the integer index domain.

Source: lib/typed-array.x:115

ArrayShort.equal

int ArrayShort.equal(ArrayShort a, ArrayShort b)

Reports elementwise native equality. Two null arrays compare equal; one null array or different lengths compare unequal.

Source: lib/typed-array.x:115

ArrayShort.find

int ArrayShort.find(ArrayShort array, short value)

Returns the first index whose native element equals value, or -1. A null array returns -1; the scan is linear and preserves source order.

Raises: <size-limit> when the length exceeds the integer index domain.

Source: lib/typed-array.x:115

ArrayShort.getindex

inline short ArrayShort.getindex(ArrayShort array, int index)

Returns the element at raw index with no bounds or null check. Negative indices are not normalized, and an invalid index has the same undefined behavior as indexing the equivalent C pointer.

Source: lib/typed-array.x:115

ArrayShort.getslice

Self ArrayShort.getslice(Self array, int start, int end, int step)

Returns a fresh packed array for normalized [start:end:step]. Negative bounds count from the end and a negative step walks backward.

Raises: <bad-arg> for a null array or zero step, <size-limit> outside the integer index domain, or <alloc-fail> on allocation failure.

Source: lib/typed-array.x:115

ArrayShort.indexof

int ArrayShort.indexof(ArrayShort array, short value)

Returns the same first-match index as ArrayShort.find.

Source: lib/typed-array.x:115

ArrayShort.insert

short ArrayShort.insert(ArrayShort array, int index, short value)

Inserts value at normalized index and returns it. The accepted range includes the position after the last element; negative indices are normalized against that wider range.

Raises: <bad-arg> for a null array or out-of-range index, <size-limit> at the integer index limit, or <alloc-fail> when storage cannot grow.

Source: lib/typed-array.x:115

ArrayShort.iter

Iter ArrayShort.iter(ArrayShort array, Iter dest)

Initializes dest to lazily yield boxed elements in index order. Returns dest, whose storage is caller-owned. The iterator borrows array and reads its current storage on each step, so both must remain live and mutation can change the remaining traversal. A null dest returns NULL. A null array, or one longer than the integer index domain, is exhausted. A boxed wide element is Scope-owned; retaining one after a pull requires its owning Scope to remain live.

Raises: any cause from boxing an element.

Source: lib/typed-array.x:120

ArrayShort.new

ArrayShort ArrayShort.new(void)

Returns a fresh empty packed array owned by the current Scope.

Raises: <alloc-fail> when storage cannot be allocated.

Source: lib/typed-array.x:115

ArrayShort.postfixindex

inline short ArrayShort.postfixindex(ArrayShort array, int index, Symbol op)

Applies ++ or -- at raw index and returns the previous value. The index has the unchecked C-pointer preconditions of bracket access.

Raises: <bad-op> for another operator. The failure does not return.

Source: lib/typed-array.x:119

ArrayShort.push

short ArrayShort.push(ArrayShort array, short value)

Appends value and returns it.

Raises: <bad-arg> for a null array, <size-limit> at the integer index limit, or <alloc-fail> when storage cannot grow.

Source: lib/typed-array.x:115

ArrayShort.remove

short ArrayShort.remove(ArrayShort array, int index)

Removes and returns the element at normalized index. Negative indices count from the end; following elements shift left.

Raises: <bad-arg> for a null array or out-of-range index, or <size-limit> when the length exceeds the integer index domain.

Source: lib/typed-array.x:115

ArrayShort.remslice

Self ArrayShort.remslice(Self array, int start, int end)

Removes normalized bounds [start:end] and returns a fresh packed array. Reversed bounds are swapped, and the removed values retain their order.

Raises: <bad-arg> for a null array, <size-limit> outside the integer index domain, or <alloc-fail> on allocation failure.

Source: lib/typed-array.x:115

ArrayShort.repr

String ArrayShort.repr(ArrayShort array)

Returns the readable packed-Array representation.

Source: lib/typed-array.x:116

ArrayShort.reverse

Self ArrayShort.reverse(Self array)

Reverses array in place and returns that same array. A null or one-element array is returned unchanged.

Source: lib/typed-array.x:115

ArrayShort.setindex

inline short ArrayShort.setindex(ArrayShort array, int index, short value)

Stores and returns value at raw index with no bounds or null check. Negative indices are not normalized, and an invalid index has the same undefined behavior as indexing the equivalent C pointer.

Source: lib/typed-array.x:115

ArrayShort.setslice

Self ArrayShort.setslice(Self array, int start, int end, Self values)

Replaces normalized bounds [start:end] and returns array. Reversed bounds are swapped; null values deletes the region. Passing array itself as values is supported and copies before mutation.

Raises: <bad-arg> for a null array, <size-limit> outside the integer index domain, or <alloc-fail> while copying self-aliased values or growing storage for the replacement. These failures leave array unchanged.

Source: lib/typed-array.x:115

ArrayShort.shift

short ArrayShort.shift(ArrayShort array)

Removes and returns the first element, shifting the remainder left. This operation is O(n).

Raises: <bad-arg> for a null or empty array, or <size-limit> when the length exceeds the integer index domain. These failures do not return.

Source: lib/typed-array.x:115

ArrayShort.splice

Self ArrayShort.splice(Self array, int index, int remove_count, Self values)

Replaces remove_count values at normalized index and returns them. The result is a fresh packed array. A nonpositive count removes nothing; null values performs deletion, and self-splicing is supported.

Raises: <bad-arg> for a null array, <size-limit> outside the integer index domain, or <alloc-fail> on allocation failure.

Source: lib/typed-array.x:115

ArrayShort.str

String ArrayShort.str(ArrayShort array)

Returns the packed-Array display String.

Source: lib/typed-array.x:116

ArrayShort.take_last

short ArrayShort.take_last(ArrayShort array)

Removes and returns the last element.

Raises: <bad-arg> for a null or empty array.

Source: lib/typed-array.x:115

ArrayShort.try_get

int ArrayShort.try_get(ArrayShort array, int index, short *out)

Reads normalized index into out and reports whether it exists. Negative indices count from the end. A null array, null out, or out-of-range index returns zero without writing; success returns one.

Raises: <size-limit> when the length exceeds the integer index domain.

Source: lib/typed-array.x:115

ArrayShort.try_next

int ArrayShort.try_next(ArrayShort array, int *cursor, short *out)

Writes the next native element, advances cursor, and returns one. Initialize the caller-owned cursor to zero. A null argument, negative cursor, exhaustion, or an array outside the integer index domain returns zero without changing cursor or out. Structural mutation invalidates the cursor.

Source: lib/typed-array.x:115

ArrayShort.try_take_last

int ArrayShort.try_take_last(ArrayShort array, short *out)

Removes the last element into out and returns one when present. A null or empty array, or null out, returns zero without writing or changing the array.

Source: lib/typed-array.x:115

ArrayShort.unshift

short ArrayShort.unshift(ArrayShort array, short value)

Inserts value at the front and returns it, shifting elements right. This operation is O(n).

Raises: <bad-arg> for a null array, <size-limit> at the integer index limit, or <alloc-fail> when storage cannot grow.

Source: lib/typed-array.x:115

ArrayShort.updateindex

inline short ArrayShort.updateindex( ArrayShort array, int index, Symbol op, short rhs)

Applies integer op to raw element index and returns the stored value. The index has the unchecked C-pointer preconditions of bracket access. Arithmetic follows the generated C operators, integer promotions, and result conversion. A failing operation leaves the element unchanged.

Raises: <div-zero>, <bad-shift>, or <bad-op> for its corresponding invalid operation.

Source: lib/typed-array.x:119

ArrayShort.var

inline Var ArrayShort.var(ArrayShort array)

Boxes array with its registered packed-array tag without copying. The boxed and typed values share the same mutable object identity.

Source: lib/typed-array.x:120

ArrayShort.write_repr

Buffer ArrayShort.write_repr(ArrayShort array, Buffer out)

Appends the readable packed-Array representation to out.

Source: lib/typed-array.x:116

ArrayShort.write_str

Buffer ArrayShort.write_str(ArrayShort array, Buffer out)

Appends the packed-Array display text to out.

Source: lib/typed-array.x:116

ArrayString

ArrayString.array

Array ArrayString.array(ArrayString array)

Returns a fresh ordinary Array containing boxed elements in source order. A null input returns NULL. The typed Array and its storage are unchanged.

Raises: any cause from boxing or appending an element.

Source: lib/typed-array.x:161

ArrayString.block

inline Block ArrayString.block(ArrayString array)

Views array as the same underlying Block storage.

Source: lib/typed-array.x:165

ArrayString.compare

int ArrayString.compare(ArrayString a, ArrayString b)

Compares packed Arrays lexicographically with the element family’s ordering. Identical handles compare equal and NULL sorts first.

Source: lib/typed-array.x:161

ArrayString.concat

Self ArrayString.concat(Self a, Self b)

Returns a fresh array holding a followed by b. Neither input is modified. A null a returns NULL, while a null b produces an independent copy of a.

Raises: <size-limit> or <alloc-fail> when the result cannot be represented or allocated.

Source: lib/typed-array.x:160

ArrayString.contains

int ArrayString.contains(ArrayString array, String value)

Reports whether a native element equals value. The scan is linear. Raises: <size-limit> when the length exceeds the integer index domain.

Source: lib/typed-array.x:160

ArrayString.copy

Self ArrayString.copy(Self array)

Returns a fresh packed copy, or NULL for a null array. The result has independent mutable storage containing the same stored values.

Raises: <size-limit> or <alloc-fail> when the copy cannot be represented or allocated.

Source: lib/typed-array.x:160

ArrayString.count

int ArrayString.count(ArrayString array, String value)

Returns how many native elements equal value. A null array returns zero; the scan is linear.

Raises: <size-limit> when the length exceeds the integer index domain.

Source: lib/typed-array.x:160

ArrayString.equal

int ArrayString.equal(ArrayString a, ArrayString b)

Reports elementwise native equality. Two null arrays compare equal; one null array or different lengths compare unequal.

Source: lib/typed-array.x:160

ArrayString.find

int ArrayString.find(ArrayString array, String value)

Returns the first index whose native element equals value, or -1. A null array returns -1; the scan is linear and preserves source order.

Raises: <size-limit> when the length exceeds the integer index domain.

Source: lib/typed-array.x:160

ArrayString.getindex

inline String ArrayString.getindex(ArrayString array, int index)

Returns the element at raw index with no bounds or null check. Negative indices are not normalized, and an invalid index has the same undefined behavior as indexing the equivalent C pointer.

Source: lib/typed-array.x:160

ArrayString.getslice

Self ArrayString.getslice(Self array, int start, int end, int step)

Returns a fresh packed array for normalized [start:end:step]. Negative bounds count from the end and a negative step walks backward.

Raises: <bad-arg> for a null array or zero step, <size-limit> outside the integer index domain, or <alloc-fail> on allocation failure.

Source: lib/typed-array.x:160

ArrayString.indexof

int ArrayString.indexof(ArrayString array, String value)

Returns the same first-match index as ArrayString.find.

Source: lib/typed-array.x:160

ArrayString.insert

String ArrayString.insert(ArrayString array, int index, String value)

Inserts value at normalized index and returns it. The accepted range includes the position after the last element; negative indices are normalized against that wider range.

Raises: <bad-arg> for a null array or out-of-range index, <size-limit> at the integer index limit, or <alloc-fail> when storage cannot grow.

Source: lib/typed-array.x:160

ArrayString.iter

Iter ArrayString.iter(ArrayString array, Iter dest)

Initializes dest to lazily yield boxed elements in index order. Returns dest, whose storage is caller-owned. The iterator borrows array and reads its current storage on each step, so both must remain live and mutation can change the remaining traversal. A null dest returns NULL. A null array, or one longer than the integer index domain, is exhausted. A boxed wide element is Scope-owned; retaining one after a pull requires its owning Scope to remain live.

Raises: any cause from boxing an element.

Source: lib/typed-array.x:165

ArrayString.new

ArrayString ArrayString.new(void)

Returns a fresh empty packed array owned by the current Scope.

Raises: <alloc-fail> when storage cannot be allocated.

Source: lib/typed-array.x:160

ArrayString.postfixindex

inline String ArrayString.postfixindex( ArrayString array, int index, Symbol op)

Raises <bad-op> because String elements have no postfix operation.

Source: lib/typed-array.x:164

ArrayString.push

String ArrayString.push(ArrayString array, String value)

Appends value and returns it.

Raises: <bad-arg> for a null array, <size-limit> at the integer index limit, or <alloc-fail> when storage cannot grow.

Source: lib/typed-array.x:160

ArrayString.remove

String ArrayString.remove(ArrayString array, int index)

Removes and returns the element at normalized index. Negative indices count from the end; following elements shift left.

Raises: <bad-arg> for a null array or out-of-range index, or <size-limit> when the length exceeds the integer index domain.

Source: lib/typed-array.x:160

ArrayString.remslice

Self ArrayString.remslice(Self array, int start, int end)

Removes normalized bounds [start:end] and returns a fresh packed array. Reversed bounds are swapped, and the removed values retain their order.

Raises: <bad-arg> for a null array, <size-limit> outside the integer index domain, or <alloc-fail> on allocation failure.

Source: lib/typed-array.x:160

ArrayString.repr

String ArrayString.repr(ArrayString array)

Returns the readable packed-Array representation.

Source: lib/typed-array.x:161

ArrayString.reverse

Self ArrayString.reverse(Self array)

Reverses array in place and returns that same array. A null or one-element array is returned unchanged.

Source: lib/typed-array.x:160

ArrayString.setindex

inline String ArrayString.setindex(ArrayString array, int index, String value)

Stores and returns value at raw index with no bounds or null check. Negative indices are not normalized, and an invalid index has the same undefined behavior as indexing the equivalent C pointer.

Source: lib/typed-array.x:160

ArrayString.setslice

Self ArrayString.setslice(Self array, int start, int end, Self values)

Replaces normalized bounds [start:end] and returns array. Reversed bounds are swapped; null values deletes the region. Passing array itself as values is supported and copies before mutation.

Raises: <bad-arg> for a null array, <size-limit> outside the integer index domain, or <alloc-fail> while copying self-aliased values or growing storage for the replacement. These failures leave array unchanged.

Source: lib/typed-array.x:160

ArrayString.shift

String ArrayString.shift(ArrayString array)

Removes and returns the first element, shifting the remainder left. This operation is O(n).

Raises: <bad-arg> for a null or empty array, or <size-limit> when the length exceeds the integer index domain. These failures do not return.

Source: lib/typed-array.x:160

ArrayString.splice

Self ArrayString.splice(Self array, int index, int remove_count, Self values)

Replaces remove_count values at normalized index and returns them. The result is a fresh packed array. A nonpositive count removes nothing; null values performs deletion, and self-splicing is supported.

Raises: <bad-arg> for a null array, <size-limit> outside the integer index domain, or <alloc-fail> on allocation failure.

Source: lib/typed-array.x:160

ArrayString.str

String ArrayString.str(ArrayString array)

Returns the packed-Array display String.

Source: lib/typed-array.x:161

ArrayString.take_last

String ArrayString.take_last(ArrayString array)

Removes and returns the last element.

Raises: <bad-arg> for a null or empty array.

Source: lib/typed-array.x:160

ArrayString.try_get

int ArrayString.try_get(ArrayString array, int index, String *out)

Reads normalized index into out and reports whether it exists. Negative indices count from the end. A null array, null out, or out-of-range index returns zero without writing; success returns one.

Raises: <size-limit> when the length exceeds the integer index domain.

Source: lib/typed-array.x:160

ArrayString.try_next

int ArrayString.try_next(ArrayString array, int *cursor, String *out)

Writes the next native element, advances cursor, and returns one. Initialize the caller-owned cursor to zero. A null argument, negative cursor, exhaustion, or an array outside the integer index domain returns zero without changing cursor or out. Structural mutation invalidates the cursor.

Source: lib/typed-array.x:160

ArrayString.try_take_last

int ArrayString.try_take_last(ArrayString array, String *out)

Removes the last element into out and returns one when present. A null or empty array, or null out, returns zero without writing or changing the array.

Source: lib/typed-array.x:160

ArrayString.unshift

String ArrayString.unshift(ArrayString array, String value)

Inserts value at the front and returns it, shifting elements right. This operation is O(n).

Raises: <bad-arg> for a null array, <size-limit> at the integer index limit, or <alloc-fail> when storage cannot grow.

Source: lib/typed-array.x:160

ArrayString.updateindex

inline String ArrayString.updateindex( ArrayString array, int index, Symbol op, String rhs)

Concatenates rhs onto the String at raw index and returns the stored canonical String. The index has the unchecked C-pointer preconditions of bracket access. Raises: <bad-op> for any operation other than +. A failure leaves the element unchanged.

Source: lib/typed-array.x:164

ArrayString.var

inline Var ArrayString.var(ArrayString array)

Boxes array with its registered packed-array tag without copying. The boxed and typed values share the same mutable object identity.

Source: lib/typed-array.x:165

ArrayString.write_repr

Buffer ArrayString.write_repr(ArrayString array, Buffer out)

Appends the readable packed-Array representation to out.

Source: lib/typed-array.x:161

ArrayString.write_str

Buffer ArrayString.write_str(ArrayString array, Buffer out)

Appends the packed-Array display text to out.

Source: lib/typed-array.x:161

Var

Var.arraychar

inline ArrayChar Var.arraychar(Var value)

Returns the packed-array pointer carried by value. value must carry this array family’s registered tag; the converter does not validate the tag before reading its pointer payload.

Source: lib/typed-array.x:111

Var.arraydbl

inline ArrayDbl Var.arraydbl(Var value)

Returns the packed-array pointer carried by value. value must carry this array family’s registered tag; the converter does not validate the tag before reading its pointer payload.

Source: lib/typed-array.x:156

Var.arrayfloat

inline ArrayFloat Var.arrayfloat(Var value)

Returns the packed-array pointer carried by value. value must carry this array family’s registered tag; the converter does not validate the tag before reading its pointer payload.

Source: lib/typed-array.x:147

Var.arrayint

inline ArrayInt Var.arrayint(Var value)

Returns the packed-array pointer carried by value. value must carry this array family’s registered tag; the converter does not validate the tag before reading its pointer payload.

Source: lib/typed-array.x:129

Var.arraylong

inline ArrayLong Var.arraylong(Var value)

Returns the packed-array pointer carried by value. value must carry this array family’s registered tag; the converter does not validate the tag before reading its pointer payload.

Source: lib/typed-array.x:138

Var.arrayshort

inline ArrayShort Var.arrayshort(Var value)

Returns the packed-array pointer carried by value. value must carry this array family’s registered tag; the converter does not validate the tag before reading its pointer payload.

Source: lib/typed-array.x:120

Var.arraystring

inline ArrayString Var.arraystring(Var value)

Returns the packed-array pointer carried by value. value must carry this array family’s registered tag; the converter does not validate the tag before reading its pointer payload.

Source: lib/typed-array.x:165

Public types

TypeKindSummary
ArrayCharaliasA mutable, Scope-owned packed Array of native char elements.
ArrayDblaliasA mutable, Scope-owned packed Array of native double elements.
ArrayFloataliasA mutable, Scope-owned packed Array of native float elements.
ArrayIntaliasA mutable, Scope-owned packed Array of native int elements.
ArrayLongaliasA mutable, Scope-owned packed Array of native long elements.
ArrayShortaliasA mutable, Scope-owned packed Array of native short elements.
ArrayStringaliasA mutable, Scope-owned packed Array of canonical String pointers.

ArrayChar

typedef Block ArrayChar

A mutable, Scope-owned packed Array of native char elements. Assignment shares its storage; ArrayChar.copy makes an independent copy.

Source: lib/typed-array.x:32

ArrayDbl

typedef Block ArrayDbl

A mutable, Scope-owned packed Array of native double elements. Assignment shares its storage; ArrayDbl.copy makes an independent copy.

Source: lib/typed-array.x:52

ArrayFloat

typedef Block ArrayFloat

A mutable, Scope-owned packed Array of native float elements. Assignment shares its storage; ArrayFloat.copy makes an independent copy.

Source: lib/typed-array.x:48

ArrayInt

typedef Block ArrayInt

A mutable, Scope-owned packed Array of native int elements. Assignment shares its storage; ArrayInt.copy makes an independent copy.

Source: lib/typed-array.x:40

ArrayLong

typedef Block ArrayLong

A mutable, Scope-owned packed Array of native long elements. Assignment shares its storage; ArrayLong.copy makes an independent copy.

Source: lib/typed-array.x:44

ArrayShort

typedef Block ArrayShort

A mutable, Scope-owned packed Array of native short elements. Assignment shares its storage; ArrayShort.copy makes an independent copy.

Source: lib/typed-array.x:36

ArrayString

typedef Block ArrayString

A mutable, Scope-owned packed Array of canonical String pointers. Assignment shares its storage; ArrayString.copy makes an independent shallow copy. Exporting an owned array recanonicalizes its Strings before replacing the backing storage while preserving the array’s identity. Borrowed or outer-owned Strings must outlive the array.

Source: lib/typed-array.x:59

Design notes

Typed Arrays own contiguous native storage over Block. Static element operations use native pointers. Var descriptors and Iter box a value only when it crosses into Var.

Bracket indexing is raw. array[index] is an inline indexed access on the concrete element pointer. There is no bounds test and no negative-index normalization, so an index outside the elements has the same undefined behavior as the equivalent C pointer. Bound loops with len, and use try_get for a checked read.

Numeric array[index] += rhs applies the generated C operator to native values, not a Var round trip; ArrayString uses canonical String concatenation. Integer promotions and result conversions follow C. Integer division by zero, invalid shifts, and unsupported operators still raise before changing the element; the boxed path’s <conv-range> is absent.

Tests and examples

make verify (unittest/test-typed-array.x).