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.getindexReads raw index with the bounds and null preconditions of a C pointer.
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 the region array[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 C-pointer preconditions.
ArrayChar.setsliceReplaces the region array[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.getindexReads raw index with the bounds and null preconditions of a C pointer.
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 the region array[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 C-pointer preconditions.
ArrayDbl.setsliceReplaces the region array[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.getindexReads raw index with the bounds and null preconditions of a C pointer.
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 the region array[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 C-pointer preconditions.
ArrayFloat.setsliceReplaces the region array[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.getindexReads raw index with the bounds and null preconditions of a C pointer.
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 the region array[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 C-pointer preconditions.
ArrayInt.setsliceReplaces the region array[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.getindexReads raw index with the bounds and null preconditions of a C pointer.
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 the region array[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 C-pointer preconditions.
ArrayLong.setsliceReplaces the region array[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.getindexReads raw index with the bounds and null preconditions of a C pointer.
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 the region array[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 C-pointer preconditions.
ArrayShort.setsliceReplaces the region array[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.getindexReads raw index with the bounds and null preconditions of a C pointer.
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 the region array[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 C-pointer preconditions.
ArrayString.setsliceReplaces the region array[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:108

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:153

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:144

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:126

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:135

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:117

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:162

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:106

ArrayChar.block

Block ArrayChar.block(ArrayChar array)

Views array as the same underlying Block storage.

Source: lib/typed-array.x:108

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:105

ArrayChar.concat

ArrayChar ArrayChar.concat(ArrayChar a, ArrayChar 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:104

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:104

ArrayChar.copy

ArrayChar ArrayChar.copy(ArrayChar 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:104

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:104

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:104

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:104

ArrayChar.getindex

char ArrayChar.getindex(ArrayChar array, int index)

Reads raw index with the bounds and null preconditions of a C pointer. Negative indices are not normalized. Use try_get for a checked read.

Source: lib/typed-array.x:104

ArrayChar.getslice

ArrayChar ArrayChar.getslice(ArrayChar 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:104

ArrayChar.indexof

int ArrayChar.indexof(ArrayChar array, char value)

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

Source: lib/typed-array.x:104

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. Boxed Array returns void for a null array or out-of-range index without mutation.

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

Source: lib/typed-array.x:104

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:110

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:104

ArrayChar.postfixindex

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:107

ArrayChar.push

char ArrayChar.push(ArrayChar array, char value)

Appends value and returns it. Boxed Array returns void for a null array.

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

Source: lib/typed-array.x:104

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. Boxed Array returns void for a null array or out-of-range index.

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

Source: lib/typed-array.x:104

ArrayChar.remslice

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

Removes the region array[start:end] and returns a fresh packed array. Bounds normalize as slice bounds, so a negative end is a stop. 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:104

ArrayChar.repr

String ArrayChar.repr(ArrayChar array)

Returns the readable packed-Array representation.

Source: lib/typed-array.x:105

ArrayChar.reverse

ArrayChar ArrayChar.reverse(ArrayChar array)

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

Source: lib/typed-array.x:104

ArrayChar.setindex

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

Stores and returns value at raw index, with C-pointer preconditions. Negative indices are not normalized; the caller supplies a valid index.

Source: lib/typed-array.x:104

ArrayChar.setslice

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

Replaces the region array[start:end] and returns array. Bounds normalize as slice bounds, so a negative end is a stop. 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:104

ArrayChar.shift

char ArrayChar.shift(ArrayChar array)

Removes and returns the first element, shifting the remainder left. This operation is O(n). Boxed Array returns void for a null or empty array.

Raises: <bad-arg> for a null or empty typed array, or <size-limit> when the length exceeds the integer index domain in either family.

Source: lib/typed-array.x:104

ArrayChar.splice

ArrayChar ArrayChar.splice(ArrayChar array, int index, int remove_count, ArrayChar 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:104

ArrayChar.str

String ArrayChar.str(ArrayChar array)

Returns the packed-Array display String.

Source: lib/typed-array.x:105

ArrayChar.take_last

char ArrayChar.take_last(ArrayChar array)

Removes and returns the last element. Boxed Array returns void for a null or empty array.

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

Source: lib/typed-array.x:104

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:104

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:104

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:104

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). Boxed Array returns void for a null array.

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

Source: lib/typed-array.x:104

ArrayChar.updateindex

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:107

ArrayChar.var

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:108

ArrayChar.write_repr

Buffer ArrayChar.write_repr(ArrayChar array, Buffer out)

Appends the readable packed-Array representation to out.

Source: lib/typed-array.x:105

ArrayChar.write_str

Buffer ArrayChar.write_str(ArrayChar array, Buffer out)

Appends the packed-Array display text to out.

Source: lib/typed-array.x:105

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:151

ArrayDbl.block

Block ArrayDbl.block(ArrayDbl array)

Views array as the same underlying Block storage.

Source: lib/typed-array.x:153

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:150

ArrayDbl.concat

ArrayDbl ArrayDbl.concat(ArrayDbl a, ArrayDbl 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:149

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:149

ArrayDbl.copy

ArrayDbl ArrayDbl.copy(ArrayDbl 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:149

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:149

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:149

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:149

ArrayDbl.getindex

double ArrayDbl.getindex(ArrayDbl array, int index)

Reads raw index with the bounds and null preconditions of a C pointer. Negative indices are not normalized. Use try_get for a checked read.

Source: lib/typed-array.x:149

ArrayDbl.getslice

ArrayDbl ArrayDbl.getslice(ArrayDbl 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:149

ArrayDbl.indexof

int ArrayDbl.indexof(ArrayDbl array, double value)

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

Source: lib/typed-array.x:149

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. Boxed Array returns void for a null array or out-of-range index without mutation.

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

Source: lib/typed-array.x:149

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:155

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:149

ArrayDbl.postfixindex

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:152

ArrayDbl.push

double ArrayDbl.push(ArrayDbl array, double value)

Appends value and returns it. Boxed Array returns void for a null array.

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

Source: lib/typed-array.x:149

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. Boxed Array returns void for a null array or out-of-range index.

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

Source: lib/typed-array.x:149

ArrayDbl.remslice

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

Removes the region array[start:end] and returns a fresh packed array. Bounds normalize as slice bounds, so a negative end is a stop. 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:149

ArrayDbl.repr

String ArrayDbl.repr(ArrayDbl array)

Returns the readable packed-Array representation.

Source: lib/typed-array.x:150

ArrayDbl.reverse

ArrayDbl ArrayDbl.reverse(ArrayDbl array)

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

Source: lib/typed-array.x:149

ArrayDbl.setindex

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

Stores and returns value at raw index, with C-pointer preconditions. Negative indices are not normalized; the caller supplies a valid index.

Source: lib/typed-array.x:149

ArrayDbl.setslice

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

Replaces the region array[start:end] and returns array. Bounds normalize as slice bounds, so a negative end is a stop. 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:149

ArrayDbl.shift

double ArrayDbl.shift(ArrayDbl array)

Removes and returns the first element, shifting the remainder left. This operation is O(n). Boxed Array returns void for a null or empty array.

Raises: <bad-arg> for a null or empty typed array, or <size-limit> when the length exceeds the integer index domain in either family.

Source: lib/typed-array.x:149

ArrayDbl.splice

ArrayDbl ArrayDbl.splice(ArrayDbl array, int index, int remove_count, ArrayDbl 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:149

ArrayDbl.str

String ArrayDbl.str(ArrayDbl array)

Returns the packed-Array display String.

Source: lib/typed-array.x:150

ArrayDbl.take_last

double ArrayDbl.take_last(ArrayDbl array)

Removes and returns the last element. Boxed Array returns void for a null or empty array.

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

Source: lib/typed-array.x:149

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:149

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:149

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:149

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). Boxed Array returns void for a null array.

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

Source: lib/typed-array.x:149

ArrayDbl.updateindex

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:152

ArrayDbl.var

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:153

ArrayDbl.write_repr

Buffer ArrayDbl.write_repr(ArrayDbl array, Buffer out)

Appends the readable packed-Array representation to out.

Source: lib/typed-array.x:150

ArrayDbl.write_str

Buffer ArrayDbl.write_str(ArrayDbl array, Buffer out)

Appends the packed-Array display text to out.

Source: lib/typed-array.x:150

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:142

ArrayFloat.block

Block ArrayFloat.block(ArrayFloat array)

Views array as the same underlying Block storage.

Source: lib/typed-array.x:144

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:141

ArrayFloat.concat

ArrayFloat ArrayFloat.concat(ArrayFloat a, ArrayFloat 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:140

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:140

ArrayFloat.copy

ArrayFloat ArrayFloat.copy(ArrayFloat 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:140

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:140

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:140

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:140

ArrayFloat.getindex

float ArrayFloat.getindex(ArrayFloat array, int index)

Reads raw index with the bounds and null preconditions of a C pointer. Negative indices are not normalized. Use try_get for a checked read.

Source: lib/typed-array.x:140

ArrayFloat.getslice

ArrayFloat ArrayFloat.getslice(ArrayFloat 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:140

ArrayFloat.indexof

int ArrayFloat.indexof(ArrayFloat array, float value)

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

Source: lib/typed-array.x:140

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. Boxed Array returns void for a null array or out-of-range index without mutation.

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

Source: lib/typed-array.x:140

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:146

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:140

ArrayFloat.postfixindex

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:143

ArrayFloat.push

float ArrayFloat.push(ArrayFloat array, float value)

Appends value and returns it. Boxed Array returns void for a null array.

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

Source: lib/typed-array.x:140

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. Boxed Array returns void for a null array or out-of-range index.

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

Source: lib/typed-array.x:140

ArrayFloat.remslice

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

Removes the region array[start:end] and returns a fresh packed array. Bounds normalize as slice bounds, so a negative end is a stop. 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:140

ArrayFloat.repr

String ArrayFloat.repr(ArrayFloat array)

Returns the readable packed-Array representation.

Source: lib/typed-array.x:141

ArrayFloat.reverse

ArrayFloat ArrayFloat.reverse(ArrayFloat array)

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

Source: lib/typed-array.x:140

ArrayFloat.setindex

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

Stores and returns value at raw index, with C-pointer preconditions. Negative indices are not normalized; the caller supplies a valid index.

Source: lib/typed-array.x:140

ArrayFloat.setslice

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

Replaces the region array[start:end] and returns array. Bounds normalize as slice bounds, so a negative end is a stop. 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:140

ArrayFloat.shift

float ArrayFloat.shift(ArrayFloat array)

Removes and returns the first element, shifting the remainder left. This operation is O(n). Boxed Array returns void for a null or empty array.

Raises: <bad-arg> for a null or empty typed array, or <size-limit> when the length exceeds the integer index domain in either family.

Source: lib/typed-array.x:140

ArrayFloat.splice

ArrayFloat ArrayFloat.splice(ArrayFloat array, int index, int remove_count, ArrayFloat 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:140

ArrayFloat.str

String ArrayFloat.str(ArrayFloat array)

Returns the packed-Array display String.

Source: lib/typed-array.x:141

ArrayFloat.take_last

float ArrayFloat.take_last(ArrayFloat array)

Removes and returns the last element. Boxed Array returns void for a null or empty array.

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

Source: lib/typed-array.x:140

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:140

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:140

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:140

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). Boxed Array returns void for a null array.

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

Source: lib/typed-array.x:140

ArrayFloat.updateindex

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:143

ArrayFloat.var

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:144

ArrayFloat.write_repr

Buffer ArrayFloat.write_repr(ArrayFloat array, Buffer out)

Appends the readable packed-Array representation to out.

Source: lib/typed-array.x:141

ArrayFloat.write_str

Buffer ArrayFloat.write_str(ArrayFloat array, Buffer out)

Appends the packed-Array display text to out.

Source: lib/typed-array.x:141

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:124

ArrayInt.block

Block ArrayInt.block(ArrayInt array)

Views array as the same underlying Block storage.

Source: lib/typed-array.x:126

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:123

ArrayInt.concat

ArrayInt ArrayInt.concat(ArrayInt a, ArrayInt 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:122

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:122

ArrayInt.copy

ArrayInt ArrayInt.copy(ArrayInt 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:122

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:122

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:122

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:122

ArrayInt.getindex

int ArrayInt.getindex(ArrayInt array, int index)

Reads raw index with the bounds and null preconditions of a C pointer. Negative indices are not normalized. Use try_get for a checked read.

Source: lib/typed-array.x:122

ArrayInt.getslice

ArrayInt ArrayInt.getslice(ArrayInt 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:122

ArrayInt.indexof

int ArrayInt.indexof(ArrayInt array, int value)

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

Source: lib/typed-array.x:122

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. Boxed Array returns void for a null array or out-of-range index without mutation.

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

Source: lib/typed-array.x:122

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:128

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:122

ArrayInt.postfixindex

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:125

ArrayInt.push

int ArrayInt.push(ArrayInt array, int value)

Appends value and returns it. Boxed Array returns void for a null array.

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

Source: lib/typed-array.x:122

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. Boxed Array returns void for a null array or out-of-range index.

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

Source: lib/typed-array.x:122

ArrayInt.remslice

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

Removes the region array[start:end] and returns a fresh packed array. Bounds normalize as slice bounds, so a negative end is a stop. 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:122

ArrayInt.repr

String ArrayInt.repr(ArrayInt array)

Returns the readable packed-Array representation.

Source: lib/typed-array.x:123

ArrayInt.reverse

ArrayInt ArrayInt.reverse(ArrayInt array)

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

Source: lib/typed-array.x:122

ArrayInt.setindex

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

Stores and returns value at raw index, with C-pointer preconditions. Negative indices are not normalized; the caller supplies a valid index.

Source: lib/typed-array.x:122

ArrayInt.setslice

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

Replaces the region array[start:end] and returns array. Bounds normalize as slice bounds, so a negative end is a stop. 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:122

ArrayInt.shift

int ArrayInt.shift(ArrayInt array)

Removes and returns the first element, shifting the remainder left. This operation is O(n). Boxed Array returns void for a null or empty array.

Raises: <bad-arg> for a null or empty typed array, or <size-limit> when the length exceeds the integer index domain in either family.

Source: lib/typed-array.x:122

ArrayInt.splice

ArrayInt ArrayInt.splice(ArrayInt array, int index, int remove_count, ArrayInt 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:122

ArrayInt.str

String ArrayInt.str(ArrayInt array)

Returns the packed-Array display String.

Source: lib/typed-array.x:123

ArrayInt.take_last

int ArrayInt.take_last(ArrayInt array)

Removes and returns the last element. Boxed Array returns void for a null or empty array.

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

Source: lib/typed-array.x:122

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:122

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:122

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:122

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). Boxed Array returns void for a null array.

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

Source: lib/typed-array.x:122

ArrayInt.updateindex

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:125

ArrayInt.var

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:126

ArrayInt.write_repr

Buffer ArrayInt.write_repr(ArrayInt array, Buffer out)

Appends the readable packed-Array representation to out.

Source: lib/typed-array.x:123

ArrayInt.write_str

Buffer ArrayInt.write_str(ArrayInt array, Buffer out)

Appends the packed-Array display text to out.

Source: lib/typed-array.x:123

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:133

ArrayLong.block

Block ArrayLong.block(ArrayLong array)

Views array as the same underlying Block storage.

Source: lib/typed-array.x:135

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:132

ArrayLong.concat

ArrayLong ArrayLong.concat(ArrayLong a, ArrayLong 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:131

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:131

ArrayLong.copy

ArrayLong ArrayLong.copy(ArrayLong 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:131

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:131

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:131

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:131

ArrayLong.getindex

long ArrayLong.getindex(ArrayLong array, int index)

Reads raw index with the bounds and null preconditions of a C pointer. Negative indices are not normalized. Use try_get for a checked read.

Source: lib/typed-array.x:131

ArrayLong.getslice

ArrayLong ArrayLong.getslice(ArrayLong 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:131

ArrayLong.indexof

int ArrayLong.indexof(ArrayLong array, long value)

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

Source: lib/typed-array.x:131

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. Boxed Array returns void for a null array or out-of-range index without mutation.

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

Source: lib/typed-array.x:131

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:137

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:131

ArrayLong.postfixindex

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:134

ArrayLong.push

long ArrayLong.push(ArrayLong array, long value)

Appends value and returns it. Boxed Array returns void for a null array.

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

Source: lib/typed-array.x:131

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. Boxed Array returns void for a null array or out-of-range index.

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

Source: lib/typed-array.x:131

ArrayLong.remslice

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

Removes the region array[start:end] and returns a fresh packed array. Bounds normalize as slice bounds, so a negative end is a stop. 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:131

ArrayLong.repr

String ArrayLong.repr(ArrayLong array)

Returns the readable packed-Array representation.

Source: lib/typed-array.x:132

ArrayLong.reverse

ArrayLong ArrayLong.reverse(ArrayLong array)

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

Source: lib/typed-array.x:131

ArrayLong.setindex

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

Stores and returns value at raw index, with C-pointer preconditions. Negative indices are not normalized; the caller supplies a valid index.

Source: lib/typed-array.x:131

ArrayLong.setslice

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

Replaces the region array[start:end] and returns array. Bounds normalize as slice bounds, so a negative end is a stop. 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:131

ArrayLong.shift

long ArrayLong.shift(ArrayLong array)

Removes and returns the first element, shifting the remainder left. This operation is O(n). Boxed Array returns void for a null or empty array.

Raises: <bad-arg> for a null or empty typed array, or <size-limit> when the length exceeds the integer index domain in either family.

Source: lib/typed-array.x:131

ArrayLong.splice

ArrayLong ArrayLong.splice(ArrayLong array, int index, int remove_count, ArrayLong 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:131

ArrayLong.str

String ArrayLong.str(ArrayLong array)

Returns the packed-Array display String.

Source: lib/typed-array.x:132

ArrayLong.take_last

long ArrayLong.take_last(ArrayLong array)

Removes and returns the last element. Boxed Array returns void for a null or empty array.

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

Source: lib/typed-array.x:131

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:131

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:131

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:131

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). Boxed Array returns void for a null array.

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

Source: lib/typed-array.x:131

ArrayLong.updateindex

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:134

ArrayLong.var

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:135

ArrayLong.write_repr

Buffer ArrayLong.write_repr(ArrayLong array, Buffer out)

Appends the readable packed-Array representation to out.

Source: lib/typed-array.x:132

ArrayLong.write_str

Buffer ArrayLong.write_str(ArrayLong array, Buffer out)

Appends the packed-Array display text to out.

Source: lib/typed-array.x:132

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:115

ArrayShort.block

Block ArrayShort.block(ArrayShort array)

Views array as the same underlying Block storage.

Source: lib/typed-array.x:117

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:114

ArrayShort.concat

ArrayShort ArrayShort.concat(ArrayShort a, ArrayShort 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:113

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:113

ArrayShort.copy

ArrayShort ArrayShort.copy(ArrayShort 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:113

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:113

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:113

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:113

ArrayShort.getindex

short ArrayShort.getindex(ArrayShort array, int index)

Reads raw index with the bounds and null preconditions of a C pointer. Negative indices are not normalized. Use try_get for a checked read.

Source: lib/typed-array.x:113

ArrayShort.getslice

ArrayShort ArrayShort.getslice(ArrayShort 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:113

ArrayShort.indexof

int ArrayShort.indexof(ArrayShort array, short value)

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

Source: lib/typed-array.x:113

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. Boxed Array returns void for a null array or out-of-range index without mutation.

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

Source: lib/typed-array.x:113

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:119

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:113

ArrayShort.postfixindex

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:116

ArrayShort.push

short ArrayShort.push(ArrayShort array, short value)

Appends value and returns it. Boxed Array returns void for a null array.

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

Source: lib/typed-array.x:113

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. Boxed Array returns void for a null array or out-of-range index.

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

Source: lib/typed-array.x:113

ArrayShort.remslice

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

Removes the region array[start:end] and returns a fresh packed array. Bounds normalize as slice bounds, so a negative end is a stop. 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:113

ArrayShort.repr

String ArrayShort.repr(ArrayShort array)

Returns the readable packed-Array representation.

Source: lib/typed-array.x:114

ArrayShort.reverse

ArrayShort ArrayShort.reverse(ArrayShort array)

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

Source: lib/typed-array.x:113

ArrayShort.setindex

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

Stores and returns value at raw index, with C-pointer preconditions. Negative indices are not normalized; the caller supplies a valid index.

Source: lib/typed-array.x:113

ArrayShort.setslice

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

Replaces the region array[start:end] and returns array. Bounds normalize as slice bounds, so a negative end is a stop. 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:113

ArrayShort.shift

short ArrayShort.shift(ArrayShort array)

Removes and returns the first element, shifting the remainder left. This operation is O(n). Boxed Array returns void for a null or empty array.

Raises: <bad-arg> for a null or empty typed array, or <size-limit> when the length exceeds the integer index domain in either family.

Source: lib/typed-array.x:113

ArrayShort.splice

ArrayShort ArrayShort.splice(ArrayShort array, int index, int remove_count, ArrayShort 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:113

ArrayShort.str

String ArrayShort.str(ArrayShort array)

Returns the packed-Array display String.

Source: lib/typed-array.x:114

ArrayShort.take_last

short ArrayShort.take_last(ArrayShort array)

Removes and returns the last element. Boxed Array returns void for a null or empty array.

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

Source: lib/typed-array.x:113

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:113

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:113

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:113

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). Boxed Array returns void for a null array.

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

Source: lib/typed-array.x:113

ArrayShort.updateindex

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:116

ArrayShort.var

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:117

ArrayShort.write_repr

Buffer ArrayShort.write_repr(ArrayShort array, Buffer out)

Appends the readable packed-Array representation to out.

Source: lib/typed-array.x:114

ArrayShort.write_str

Buffer ArrayShort.write_str(ArrayShort array, Buffer out)

Appends the packed-Array display text to out.

Source: lib/typed-array.x:114

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:160

ArrayString.block

Block ArrayString.block(ArrayString array)

Views array as the same underlying Block storage.

Source: lib/typed-array.x:162

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:159

ArrayString.concat

ArrayString ArrayString.concat(ArrayString a, ArrayString 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:158

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:158

ArrayString.copy

ArrayString ArrayString.copy(ArrayString 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:158

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:158

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:158

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:158

ArrayString.getindex

String ArrayString.getindex(ArrayString array, int index)

Reads raw index with the bounds and null preconditions of a C pointer. Negative indices are not normalized. Use try_get for a checked read.

Source: lib/typed-array.x:158

ArrayString.getslice

ArrayString ArrayString.getslice(ArrayString 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:158

ArrayString.indexof

int ArrayString.indexof(ArrayString array, String value)

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

Source: lib/typed-array.x:158

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. Boxed Array returns void for a null array or out-of-range index without mutation.

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

Source: lib/typed-array.x:158

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:158

ArrayString.postfixindex

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

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

Source: lib/typed-array.x:161

ArrayString.push

String ArrayString.push(ArrayString array, String value)

Appends value and returns it. Boxed Array returns void for a null array.

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

Source: lib/typed-array.x:158

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. Boxed Array returns void for a null array or out-of-range index.

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

Source: lib/typed-array.x:158

ArrayString.remslice

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

Removes the region array[start:end] and returns a fresh packed array. Bounds normalize as slice bounds, so a negative end is a stop. 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:158

ArrayString.repr

String ArrayString.repr(ArrayString array)

Returns the readable packed-Array representation.

Source: lib/typed-array.x:159

ArrayString.reverse

ArrayString ArrayString.reverse(ArrayString array)

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

Source: lib/typed-array.x:158

ArrayString.setindex

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

Stores and returns value at raw index, with C-pointer preconditions. Negative indices are not normalized; the caller supplies a valid index.

Source: lib/typed-array.x:158

ArrayString.setslice

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

Replaces the region array[start:end] and returns array. Bounds normalize as slice bounds, so a negative end is a stop. 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:158

ArrayString.shift

String ArrayString.shift(ArrayString array)

Removes and returns the first element, shifting the remainder left. This operation is O(n). Boxed Array returns void for a null or empty array.

Raises: <bad-arg> for a null or empty typed array, or <size-limit> when the length exceeds the integer index domain in either family.

Source: lib/typed-array.x:158

ArrayString.splice

ArrayString ArrayString.splice(ArrayString array, int index, int remove_count, ArrayString 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:158

ArrayString.str

String ArrayString.str(ArrayString array)

Returns the packed-Array display String.

Source: lib/typed-array.x:159

ArrayString.take_last

String ArrayString.take_last(ArrayString array)

Removes and returns the last element. Boxed Array returns void for a null or empty array.

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

Source: lib/typed-array.x:158

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:158

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:158

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:158

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). Boxed Array returns void for a null array.

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

Source: lib/typed-array.x:158

ArrayString.updateindex

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:161

ArrayString.var

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:162

ArrayString.write_repr

Buffer ArrayString.write_repr(ArrayString array, Buffer out)

Appends the readable packed-Array representation to out.

Source: lib/typed-array.x:159

ArrayString.write_str

Buffer ArrayString.write_str(ArrayString array, Buffer out)

Appends the packed-Array display text to out.

Source: lib/typed-array.x:159

Var

Var.arraychar

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:108

Var.arraydbl

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:153

Var.arrayfloat

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:144

Var.arrayint

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:126

Var.arraylong

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:135

Var.arrayshort

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:117

Var.arraystring

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:162

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).