lib/typed-array.x
Packed typed Arrays generated from shared methods.
Primary API
| Function | Summary |
|---|---|
Array.arraychar | Packs values into a fresh array in source order. |
Array.arraydbl | Packs values into a fresh array in source order. |
Array.arrayfloat | Packs values into a fresh array in source order. |
Array.arrayint | Packs values into a fresh array in source order. |
Array.arraylong | Packs values into a fresh array in source order. |
Array.arrayshort | Packs values into a fresh array in source order. |
Array.arraystring | Packs values into a fresh array in source order. |
ArrayChar.array | Returns a fresh ordinary Array containing boxed elements in source order. |
ArrayChar.block | Views array as the same underlying Block storage. |
ArrayChar.compare | Compares packed Arrays lexicographically with the element family’s ordering. |
ArrayChar.concat | Returns a fresh array holding a followed by b. |
ArrayChar.contains | Reports whether a native element equals value. |
ArrayChar.copy | Returns a fresh packed copy, or NULL for a null array. |
ArrayChar.count | Returns how many native elements equal value. |
ArrayChar.equal | Reports elementwise native equality. |
ArrayChar.find | Returns the first index whose native element equals value, or -1. |
ArrayChar.getindex | Returns the element at raw index with no bounds or null check. |
ArrayChar.getslice | Returns a fresh packed array for normalized [start:end:step]. |
ArrayChar.indexof | Returns the same first-match index as ArrayChar.find. |
ArrayChar.insert | Inserts value at normalized index and returns it. |
ArrayChar.iter | Initializes dest to lazily yield boxed elements in index order. |
ArrayChar.new | Returns a fresh empty packed array owned by the current Scope. |
ArrayChar.postfixindex | Applies ++ or -- at raw index and returns the previous value. |
ArrayChar.push | Appends value and returns it. |
ArrayChar.remove | Removes and returns the element at normalized index. |
ArrayChar.remslice | Removes normalized bounds [start:end] and returns a fresh packed array. |
ArrayChar.repr | Returns the readable packed-Array representation. |
ArrayChar.reverse | Reverses array in place and returns that same array. |
ArrayChar.setindex | Stores and returns value at raw index with no bounds or null check. |
ArrayChar.setslice | Replaces normalized bounds [start:end] and returns array. |
ArrayChar.shift | Removes and returns the first element, shifting the remainder left. |
ArrayChar.splice | Replaces remove_count values at normalized index and returns them. |
ArrayChar.str | Returns the packed-Array display String. |
ArrayChar.take_last | Removes and returns the last element. |
ArrayChar.try_get | Reads normalized index into out and reports whether it exists. |
ArrayChar.try_next | Writes the next native element, advances cursor, and returns one. |
ArrayChar.try_take_last | Removes the last element into out and returns one when present. |
ArrayChar.unshift | Inserts value at the front and returns it, shifting elements right. |
ArrayChar.updateindex | Applies integer op to raw element index and returns the stored value. |
ArrayChar.var | Boxes array with its registered packed-array tag without copying. |
ArrayChar.write_repr | Appends the readable packed-Array representation to out. |
ArrayChar.write_str | Appends the packed-Array display text to out. |
ArrayDbl.array | Returns a fresh ordinary Array containing boxed elements in source order. |
ArrayDbl.block | Views array as the same underlying Block storage. |
ArrayDbl.compare | Compares packed Arrays lexicographically with the element family’s ordering. |
ArrayDbl.concat | Returns a fresh array holding a followed by b. |
ArrayDbl.contains | Reports whether a native element equals value. |
ArrayDbl.copy | Returns a fresh packed copy, or NULL for a null array. |
ArrayDbl.count | Returns how many native elements equal value. |
ArrayDbl.equal | Reports elementwise native equality. |
ArrayDbl.find | Returns the first index whose native element equals value, or -1. |
ArrayDbl.getindex | Returns the element at raw index with no bounds or null check. |
ArrayDbl.getslice | Returns a fresh packed array for normalized [start:end:step]. |
ArrayDbl.indexof | Returns the same first-match index as ArrayDbl.find. |
ArrayDbl.insert | Inserts value at normalized index and returns it. |
ArrayDbl.iter | Initializes dest to lazily yield boxed elements in index order. |
ArrayDbl.new | Returns a fresh empty packed array owned by the current Scope. |
ArrayDbl.postfixindex | Applies ++ or -- at raw index and returns the previous value. |
ArrayDbl.push | Appends value and returns it. |
ArrayDbl.remove | Removes and returns the element at normalized index. |
ArrayDbl.remslice | Removes normalized bounds [start:end] and returns a fresh packed array. |
ArrayDbl.repr | Returns the readable packed-Array representation. |
ArrayDbl.reverse | Reverses array in place and returns that same array. |
ArrayDbl.setindex | Stores and returns value at raw index with no bounds or null check. |
ArrayDbl.setslice | Replaces normalized bounds [start:end] and returns array. |
ArrayDbl.shift | Removes and returns the first element, shifting the remainder left. |
ArrayDbl.splice | Replaces remove_count values at normalized index and returns them. |
ArrayDbl.str | Returns the packed-Array display String. |
ArrayDbl.take_last | Removes and returns the last element. |
ArrayDbl.try_get | Reads normalized index into out and reports whether it exists. |
ArrayDbl.try_next | Writes the next native element, advances cursor, and returns one. |
ArrayDbl.try_take_last | Removes the last element into out and returns one when present. |
ArrayDbl.unshift | Inserts value at the front and returns it, shifting elements right. |
ArrayDbl.updateindex | Applies a floating arithmetic op and returns the stored value. |
ArrayDbl.var | Boxes array with its registered packed-array tag without copying. |
ArrayDbl.write_repr | Appends the readable packed-Array representation to out. |
ArrayDbl.write_str | Appends the packed-Array display text to out. |
ArrayFloat.array | Returns a fresh ordinary Array containing boxed elements in source order. |
ArrayFloat.block | Views array as the same underlying Block storage. |
ArrayFloat.compare | Compares packed Arrays lexicographically with the element family’s ordering. |
ArrayFloat.concat | Returns a fresh array holding a followed by b. |
ArrayFloat.contains | Reports whether a native element equals value. |
ArrayFloat.copy | Returns a fresh packed copy, or NULL for a null array. |
ArrayFloat.count | Returns how many native elements equal value. |
ArrayFloat.equal | Reports elementwise native equality. |
ArrayFloat.find | Returns the first index whose native element equals value, or -1. |
ArrayFloat.getindex | Returns the element at raw index with no bounds or null check. |
ArrayFloat.getslice | Returns a fresh packed array for normalized [start:end:step]. |
ArrayFloat.indexof | Returns the same first-match index as ArrayFloat.find. |
ArrayFloat.insert | Inserts value at normalized index and returns it. |
ArrayFloat.iter | Initializes dest to lazily yield boxed elements in index order. |
ArrayFloat.new | Returns a fresh empty packed array owned by the current Scope. |
ArrayFloat.postfixindex | Applies ++ or -- at raw index and returns the previous value. |
ArrayFloat.push | Appends value and returns it. |
ArrayFloat.remove | Removes and returns the element at normalized index. |
ArrayFloat.remslice | Removes normalized bounds [start:end] and returns a fresh packed array. |
ArrayFloat.repr | Returns the readable packed-Array representation. |
ArrayFloat.reverse | Reverses array in place and returns that same array. |
ArrayFloat.setindex | Stores and returns value at raw index with no bounds or null check. |
ArrayFloat.setslice | Replaces normalized bounds [start:end] and returns array. |
ArrayFloat.shift | Removes and returns the first element, shifting the remainder left. |
ArrayFloat.splice | Replaces remove_count values at normalized index and returns them. |
ArrayFloat.str | Returns the packed-Array display String. |
ArrayFloat.take_last | Removes and returns the last element. |
ArrayFloat.try_get | Reads normalized index into out and reports whether it exists. |
ArrayFloat.try_next | Writes the next native element, advances cursor, and returns one. |
ArrayFloat.try_take_last | Removes the last element into out and returns one when present. |
ArrayFloat.unshift | Inserts value at the front and returns it, shifting elements right. |
ArrayFloat.updateindex | Applies a floating arithmetic op and returns the stored value. |
ArrayFloat.var | Boxes array with its registered packed-array tag without copying. |
ArrayFloat.write_repr | Appends the readable packed-Array representation to out. |
ArrayFloat.write_str | Appends the packed-Array display text to out. |
ArrayInt.array | Returns a fresh ordinary Array containing boxed elements in source order. |
ArrayInt.block | Views array as the same underlying Block storage. |
ArrayInt.compare | Compares packed Arrays lexicographically with the element family’s ordering. |
ArrayInt.concat | Returns a fresh array holding a followed by b. |
ArrayInt.contains | Reports whether a native element equals value. |
ArrayInt.copy | Returns a fresh packed copy, or NULL for a null array. |
ArrayInt.count | Returns how many native elements equal value. |
ArrayInt.equal | Reports elementwise native equality. |
ArrayInt.find | Returns the first index whose native element equals value, or -1. |
ArrayInt.getindex | Returns the element at raw index with no bounds or null check. |
ArrayInt.getslice | Returns a fresh packed array for normalized [start:end:step]. |
ArrayInt.indexof | Returns the same first-match index as ArrayInt.find. |
ArrayInt.insert | Inserts value at normalized index and returns it. |
ArrayInt.iter | Initializes dest to lazily yield boxed elements in index order. |
ArrayInt.new | Returns a fresh empty packed array owned by the current Scope. |
ArrayInt.postfixindex | Applies ++ or -- at raw index and returns the previous value. |
ArrayInt.push | Appends value and returns it. |
ArrayInt.remove | Removes and returns the element at normalized index. |
ArrayInt.remslice | Removes normalized bounds [start:end] and returns a fresh packed array. |
ArrayInt.repr | Returns the readable packed-Array representation. |
ArrayInt.reverse | Reverses array in place and returns that same array. |
ArrayInt.setindex | Stores and returns value at raw index with no bounds or null check. |
ArrayInt.setslice | Replaces normalized bounds [start:end] and returns array. |
ArrayInt.shift | Removes and returns the first element, shifting the remainder left. |
ArrayInt.splice | Replaces remove_count values at normalized index and returns them. |
ArrayInt.str | Returns the packed-Array display String. |
ArrayInt.take_last | Removes and returns the last element. |
ArrayInt.try_get | Reads normalized index into out and reports whether it exists. |
ArrayInt.try_next | Writes the next native element, advances cursor, and returns one. |
ArrayInt.try_take_last | Removes the last element into out and returns one when present. |
ArrayInt.unshift | Inserts value at the front and returns it, shifting elements right. |
ArrayInt.updateindex | Applies integer op to raw element index and returns the stored value. |
ArrayInt.var | Boxes array with its registered packed-array tag without copying. |
ArrayInt.write_repr | Appends the readable packed-Array representation to out. |
ArrayInt.write_str | Appends the packed-Array display text to out. |
ArrayLong.array | Returns a fresh ordinary Array containing boxed elements in source order. |
ArrayLong.block | Views array as the same underlying Block storage. |
ArrayLong.compare | Compares packed Arrays lexicographically with the element family’s ordering. |
ArrayLong.concat | Returns a fresh array holding a followed by b. |
ArrayLong.contains | Reports whether a native element equals value. |
ArrayLong.copy | Returns a fresh packed copy, or NULL for a null array. |
ArrayLong.count | Returns how many native elements equal value. |
ArrayLong.equal | Reports elementwise native equality. |
ArrayLong.find | Returns the first index whose native element equals value, or -1. |
ArrayLong.getindex | Returns the element at raw index with no bounds or null check. |
ArrayLong.getslice | Returns a fresh packed array for normalized [start:end:step]. |
ArrayLong.indexof | Returns the same first-match index as ArrayLong.find. |
ArrayLong.insert | Inserts value at normalized index and returns it. |
ArrayLong.iter | Initializes dest to lazily yield boxed elements in index order. |
ArrayLong.new | Returns a fresh empty packed array owned by the current Scope. |
ArrayLong.postfixindex | Applies ++ or -- at raw index and returns the previous value. |
ArrayLong.push | Appends value and returns it. |
ArrayLong.remove | Removes and returns the element at normalized index. |
ArrayLong.remslice | Removes normalized bounds [start:end] and returns a fresh packed array. |
ArrayLong.repr | Returns the readable packed-Array representation. |
ArrayLong.reverse | Reverses array in place and returns that same array. |
ArrayLong.setindex | Stores and returns value at raw index with no bounds or null check. |
ArrayLong.setslice | Replaces normalized bounds [start:end] and returns array. |
ArrayLong.shift | Removes and returns the first element, shifting the remainder left. |
ArrayLong.splice | Replaces remove_count values at normalized index and returns them. |
ArrayLong.str | Returns the packed-Array display String. |
ArrayLong.take_last | Removes and returns the last element. |
ArrayLong.try_get | Reads normalized index into out and reports whether it exists. |
ArrayLong.try_next | Writes the next native element, advances cursor, and returns one. |
ArrayLong.try_take_last | Removes the last element into out and returns one when present. |
ArrayLong.unshift | Inserts value at the front and returns it, shifting elements right. |
ArrayLong.updateindex | Applies integer op to raw element index and returns the stored value. |
ArrayLong.var | Boxes array with its registered packed-array tag without copying. |
ArrayLong.write_repr | Appends the readable packed-Array representation to out. |
ArrayLong.write_str | Appends the packed-Array display text to out. |
ArrayShort.array | Returns a fresh ordinary Array containing boxed elements in source order. |
ArrayShort.block | Views array as the same underlying Block storage. |
ArrayShort.compare | Compares packed Arrays lexicographically with the element family’s ordering. |
ArrayShort.concat | Returns a fresh array holding a followed by b. |
ArrayShort.contains | Reports whether a native element equals value. |
ArrayShort.copy | Returns a fresh packed copy, or NULL for a null array. |
ArrayShort.count | Returns how many native elements equal value. |
ArrayShort.equal | Reports elementwise native equality. |
ArrayShort.find | Returns the first index whose native element equals value, or -1. |
ArrayShort.getindex | Returns the element at raw index with no bounds or null check. |
ArrayShort.getslice | Returns a fresh packed array for normalized [start:end:step]. |
ArrayShort.indexof | Returns the same first-match index as ArrayShort.find. |
ArrayShort.insert | Inserts value at normalized index and returns it. |
ArrayShort.iter | Initializes dest to lazily yield boxed elements in index order. |
ArrayShort.new | Returns a fresh empty packed array owned by the current Scope. |
ArrayShort.postfixindex | Applies ++ or -- at raw index and returns the previous value. |
ArrayShort.push | Appends value and returns it. |
ArrayShort.remove | Removes and returns the element at normalized index. |
ArrayShort.remslice | Removes normalized bounds [start:end] and returns a fresh packed array. |
ArrayShort.repr | Returns the readable packed-Array representation. |
ArrayShort.reverse | Reverses array in place and returns that same array. |
ArrayShort.setindex | Stores and returns value at raw index with no bounds or null check. |
ArrayShort.setslice | Replaces normalized bounds [start:end] and returns array. |
ArrayShort.shift | Removes and returns the first element, shifting the remainder left. |
ArrayShort.splice | Replaces remove_count values at normalized index and returns them. |
ArrayShort.str | Returns the packed-Array display String. |
ArrayShort.take_last | Removes and returns the last element. |
ArrayShort.try_get | Reads normalized index into out and reports whether it exists. |
ArrayShort.try_next | Writes the next native element, advances cursor, and returns one. |
ArrayShort.try_take_last | Removes the last element into out and returns one when present. |
ArrayShort.unshift | Inserts value at the front and returns it, shifting elements right. |
ArrayShort.updateindex | Applies integer op to raw element index and returns the stored value. |
ArrayShort.var | Boxes array with its registered packed-array tag without copying. |
ArrayShort.write_repr | Appends the readable packed-Array representation to out. |
ArrayShort.write_str | Appends the packed-Array display text to out. |
ArrayString.array | Returns a fresh ordinary Array containing boxed elements in source order. |
ArrayString.block | Views array as the same underlying Block storage. |
ArrayString.compare | Compares packed Arrays lexicographically with the element family’s ordering. |
ArrayString.concat | Returns a fresh array holding a followed by b. |
ArrayString.contains | Reports whether a native element equals value. |
ArrayString.copy | Returns a fresh packed copy, or NULL for a null array. |
ArrayString.count | Returns how many native elements equal value. |
ArrayString.equal | Reports elementwise native equality. |
ArrayString.find | Returns the first index whose native element equals value, or -1. |
ArrayString.getindex | Returns the element at raw index with no bounds or null check. |
ArrayString.getslice | Returns a fresh packed array for normalized [start:end:step]. |
ArrayString.indexof | Returns the same first-match index as ArrayString.find. |
ArrayString.insert | Inserts value at normalized index and returns it. |
ArrayString.iter | Initializes dest to lazily yield boxed elements in index order. |
ArrayString.new | Returns a fresh empty packed array owned by the current Scope. |
ArrayString.postfixindex | Raises <bad-op> because String elements have no postfix operation. |
ArrayString.push | Appends value and returns it. |
ArrayString.remove | Removes and returns the element at normalized index. |
ArrayString.remslice | Removes normalized bounds [start:end] and returns a fresh packed array. |
ArrayString.repr | Returns the readable packed-Array representation. |
ArrayString.reverse | Reverses array in place and returns that same array. |
ArrayString.setindex | Stores and returns value at raw index with no bounds or null check. |
ArrayString.setslice | Replaces normalized bounds [start:end] and returns array. |
ArrayString.shift | Removes and returns the first element, shifting the remainder left. |
ArrayString.splice | Replaces remove_count values at normalized index and returns them. |
ArrayString.str | Returns the packed-Array display String. |
ArrayString.take_last | Removes and returns the last element. |
ArrayString.try_get | Reads normalized index into out and reports whether it exists. |
ArrayString.try_next | Writes the next native element, advances cursor, and returns one. |
ArrayString.try_take_last | Removes the last element into out and returns one when present. |
ArrayString.unshift | Inserts value at the front and returns it, shifting elements right. |
ArrayString.updateindex | Concatenates rhs onto the String at raw index and returns the stored canonical String. |
ArrayString.var | Boxes array with its registered packed-array tag without copying. |
ArrayString.write_repr | Appends the readable packed-Array representation to out. |
ArrayString.write_str | Appends the packed-Array display text to out. |
Var.arraychar | Returns the packed-array pointer carried by value. |
Var.arraydbl | Returns the packed-array pointer carried by value. |
Var.arrayfloat | Returns the packed-array pointer carried by value. |
Var.arrayint | Returns the packed-array pointer carried by value. |
Var.arraylong | Returns the packed-array pointer carried by value. |
Var.arrayshort | Returns the packed-array pointer carried by value. |
Var.arraystring | Returns the packed-array pointer carried by value. |
Array
Array.arraychar
ArrayChar Array.arraychar(Array values)
Packs values into a fresh array in source order.
A null input returns NULL. Each element goes through its Var
conversion; the source is unchanged and a failing conversion or
allocation releases the partial result before transferring its cause.
Source: lib/typed-array.x:111
Array.arraydbl
ArrayDbl Array.arraydbl(Array values)
Packs values into a fresh array in source order.
A null input returns NULL. Each element goes through its Var
conversion; the source is unchanged and a failing conversion or
allocation releases the partial result before transferring its cause.
Source: lib/typed-array.x:156
Array.arrayfloat
ArrayFloat Array.arrayfloat(Array values)
Packs values into a fresh array in source order.
A null input returns NULL. Each element goes through its Var
conversion; the source is unchanged and a failing conversion or
allocation releases the partial result before transferring its cause.
Source: lib/typed-array.x:147
Array.arrayint
ArrayInt Array.arrayint(Array values)
Packs values into a fresh array in source order.
A null input returns NULL. Each element goes through its Var
conversion; the source is unchanged and a failing conversion or
allocation releases the partial result before transferring its cause.
Source: lib/typed-array.x:129
Array.arraylong
ArrayLong Array.arraylong(Array values)
Packs values into a fresh array in source order.
A null input returns NULL. Each element goes through its Var
conversion; the source is unchanged and a failing conversion or
allocation releases the partial result before transferring its cause.
Source: lib/typed-array.x:138
Array.arrayshort
ArrayShort Array.arrayshort(Array values)
Packs values into a fresh array in source order.
A null input returns NULL. Each element goes through its Var
conversion; the source is unchanged and a failing conversion or
allocation releases the partial result before transferring its cause.
Source: lib/typed-array.x:120
Array.arraystring
ArrayString Array.arraystring(Array values)
Packs values into a fresh array in source order.
A null input returns NULL. Each element goes through its Var
conversion; the source is unchanged and a failing conversion or
allocation releases the partial result before transferring its cause.
Source: lib/typed-array.x:165
ArrayChar
ArrayChar.array
Array ArrayChar.array(ArrayChar array)
Returns a fresh ordinary Array containing boxed elements in source order. A null input returns NULL. The typed Array and its storage are unchanged.
Raises: any cause from boxing or appending an element.
Source: lib/typed-array.x:107
ArrayChar.block
inline Block ArrayChar.block(ArrayChar array)
Views array as the same underlying Block storage.
Source: lib/typed-array.x:111
ArrayChar.compare
int ArrayChar.compare(ArrayChar a, ArrayChar b)
Compares packed Arrays lexicographically with the element family’s ordering. Identical handles compare equal and NULL sorts first.
Source: lib/typed-array.x:107
ArrayChar.concat
Self ArrayChar.concat(Self a, Self b)
Returns a fresh array holding a followed by b.
Neither input is modified. A null a returns NULL, while a null b
produces an independent copy of a.
Raises: <size-limit> or <alloc-fail> when the result cannot be
represented or allocated.
Source: lib/typed-array.x:106
ArrayChar.contains
int ArrayChar.contains(ArrayChar array, char value)
Reports whether a native element equals value.
The scan is linear. Raises: <size-limit> when the length exceeds the
integer index domain.
Source: lib/typed-array.x:106
ArrayChar.copy
Self ArrayChar.copy(Self array)
Returns a fresh packed copy, or NULL for a null array. The result has independent mutable storage containing the same stored values.
Raises: <size-limit> or <alloc-fail> when the copy cannot be
represented or allocated.
Source: lib/typed-array.x:106
ArrayChar.count
int ArrayChar.count(ArrayChar array, char value)
Returns how many native elements equal value.
A null array returns zero; the scan is linear.
Raises: <size-limit> when the length exceeds the integer index domain.
Source: lib/typed-array.x:106
ArrayChar.equal
int ArrayChar.equal(ArrayChar a, ArrayChar b)
Reports elementwise native equality. Two null arrays compare equal; one null array or different lengths compare unequal.
Source: lib/typed-array.x:106
ArrayChar.find
int ArrayChar.find(ArrayChar array, char value)
Returns the first index whose native element equals value, or -1.
A null array returns -1; the scan is linear and preserves source order.
Raises: <size-limit> when the length exceeds the integer index domain.
Source: lib/typed-array.x:106
ArrayChar.getindex
inline char ArrayChar.getindex(ArrayChar array, int index)
Returns the element at raw index with no bounds or null check.
Negative indices are not normalized, and an invalid index has the same
undefined behavior as indexing the equivalent C pointer.
Source: lib/typed-array.x:106
ArrayChar.getslice
Self ArrayChar.getslice(Self array, int start, int end, int step)
Returns a fresh packed array for normalized [start:end:step].
Negative bounds count from the end and a negative step walks backward.
Raises: <bad-arg> for a null array or zero step, <size-limit> outside
the integer index domain, or <alloc-fail> on allocation failure.
Source: lib/typed-array.x:106
ArrayChar.indexof
int ArrayChar.indexof(ArrayChar array, char value)
Returns the same first-match index as ArrayChar.find.
Source: lib/typed-array.x:106
ArrayChar.insert
char ArrayChar.insert(ArrayChar array, int index, char value)
Inserts value at normalized index and returns it.
The accepted range includes the position after the last element;
negative indices are normalized against that wider range.
Raises: <bad-arg> for a null array or out-of-range index,
<size-limit> at the integer index limit, or <alloc-fail> when storage
cannot grow.
Source: lib/typed-array.x:106
ArrayChar.iter
Iter ArrayChar.iter(ArrayChar array, Iter dest)
Initializes dest to lazily yield boxed elements in index order.
Returns dest, whose storage is caller-owned. The iterator borrows
array and reads its current storage on each step, so both must remain
live and mutation can change the remaining traversal. A null dest
returns NULL. A null array, or one longer than the integer index domain,
is exhausted. A boxed wide element is Scope-owned;
retaining one after a
pull requires its owning Scope to remain live.
Raises: any cause from boxing an element.
Source: lib/typed-array.x:111
ArrayChar.new
ArrayChar ArrayChar.new(void)
Returns a fresh empty packed array owned by the current Scope.
Raises: <alloc-fail> when storage cannot be allocated.
Source: lib/typed-array.x:106
ArrayChar.postfixindex
inline char ArrayChar.postfixindex(ArrayChar array, int index, Symbol op)
Applies ++ or -- at raw index and returns the previous value.
The index has the unchecked C-pointer preconditions of bracket access.
Raises: <bad-op> for another operator. The failure does not return.
Source: lib/typed-array.x:110
ArrayChar.push
char ArrayChar.push(ArrayChar array, char value)
Appends value and returns it.
Raises: <bad-arg> for a null array, <size-limit> at the integer index
limit, or <alloc-fail> when storage cannot grow.
Source: lib/typed-array.x:106
ArrayChar.remove
char ArrayChar.remove(ArrayChar array, int index)
Removes and returns the element at normalized index.
Negative indices count from the end; following elements shift left.
Raises: <bad-arg> for a null array or out-of-range index, or
<size-limit> when the length exceeds the integer index domain.
Source: lib/typed-array.x:106
ArrayChar.remslice
Self ArrayChar.remslice(Self array, int start, int end)
Removes normalized bounds [start:end] and returns a fresh packed array.
Reversed bounds are swapped, and the removed values retain their order.
Raises: <bad-arg> for a null array, <size-limit> outside the integer
index domain, or <alloc-fail> on allocation failure.
Source: lib/typed-array.x:106
ArrayChar.repr
String ArrayChar.repr(ArrayChar array)
Returns the readable packed-Array representation.
Source: lib/typed-array.x:107
ArrayChar.reverse
Self ArrayChar.reverse(Self array)
Reverses array in place and returns that same array.
A null or one-element array is returned unchanged.
Source: lib/typed-array.x:106
ArrayChar.setindex
inline char ArrayChar.setindex(ArrayChar array, int index, char value)
Stores and returns value at raw index with no bounds or null check.
Negative indices are not normalized, and an invalid index has the same
undefined behavior as indexing the equivalent C pointer.
Source: lib/typed-array.x:106
ArrayChar.setslice
Self ArrayChar.setslice(Self array, int start, int end, Self values)
Replaces normalized bounds [start:end] and returns array.
Reversed bounds are swapped; null values deletes the region. Passing
array itself as values is supported and copies before mutation.
Raises: <bad-arg> for a null array, <size-limit> outside the integer
index domain, or <alloc-fail> while copying self-aliased values or
growing storage for the replacement. These failures leave array
unchanged.
Source: lib/typed-array.x:106
ArrayChar.shift
char ArrayChar.shift(ArrayChar array)
Removes and returns the first element, shifting the remainder left. This operation is O(n).
Raises: <bad-arg> for a null or empty array, or <size-limit> when the
length exceeds the integer index domain. These failures do not return.
Source: lib/typed-array.x:106
ArrayChar.splice
Self ArrayChar.splice(Self array, int index, int remove_count, Self values)
Replaces remove_count values at normalized index and returns them.
The result is a fresh packed array. A nonpositive count removes nothing;
null values performs deletion, and self-splicing is supported.
Raises: <bad-arg> for a null array, <size-limit> outside the integer
index domain, or <alloc-fail> on allocation failure.
Source: lib/typed-array.x:106
ArrayChar.str
String ArrayChar.str(ArrayChar array)
Returns the packed-Array display String.
Source: lib/typed-array.x:107
ArrayChar.take_last
char ArrayChar.take_last(ArrayChar array)
Removes and returns the last element.
Raises: <bad-arg> for a null or empty array.
Source: lib/typed-array.x:106
ArrayChar.try_get
int ArrayChar.try_get(ArrayChar array, int index, char *out)
Reads normalized index into out and reports whether it exists.
Negative indices count from the end. A null array, null out, or
out-of-range index returns zero without writing; success returns one.
Raises: <size-limit> when the length exceeds the integer index domain.
Source: lib/typed-array.x:106
ArrayChar.try_next
int ArrayChar.try_next(ArrayChar array, int *cursor, char *out)
Writes the next native element, advances cursor, and returns one.
Initialize the caller-owned cursor to zero. A null argument, negative
cursor, exhaustion, or an array outside the integer index domain returns
zero without changing cursor or out. Structural mutation invalidates
the cursor.
Source: lib/typed-array.x:106
ArrayChar.try_take_last
int ArrayChar.try_take_last(ArrayChar array, char *out)
Removes the last element into out and returns one when present.
A null or empty array, or null out, returns zero without writing or
changing the array.
Source: lib/typed-array.x:106
ArrayChar.unshift
char ArrayChar.unshift(ArrayChar array, char value)
Inserts value at the front and returns it, shifting elements right.
This operation is O(n).
Raises: <bad-arg> for a null array, <size-limit> at the integer index
limit, or <alloc-fail> when storage cannot grow.
Source: lib/typed-array.x:106
ArrayChar.updateindex
inline char ArrayChar.updateindex( ArrayChar array, int index, Symbol op, char rhs)
Applies integer op to raw element index and returns the stored value.
The index has the unchecked C-pointer preconditions of bracket access.
Arithmetic follows the generated C operators, integer promotions, and
result conversion. A failing operation leaves the element unchanged.
Raises: <div-zero>, <bad-shift>, or <bad-op> for its corresponding
invalid operation.
Source: lib/typed-array.x:110
ArrayChar.var
inline Var ArrayChar.var(ArrayChar array)
Boxes array with its registered packed-array tag without copying.
The boxed and typed values share the same mutable object identity.
Source: lib/typed-array.x:111
ArrayChar.write_repr
Buffer ArrayChar.write_repr(ArrayChar array, Buffer out)
Appends the readable packed-Array representation to out.
Source: lib/typed-array.x:107
ArrayChar.write_str
Buffer ArrayChar.write_str(ArrayChar array, Buffer out)
Appends the packed-Array display text to out.
Source: lib/typed-array.x:107
ArrayDbl
ArrayDbl.array
Array ArrayDbl.array(ArrayDbl array)
Returns a fresh ordinary Array containing boxed elements in source order. A null input returns NULL. The typed Array and its storage are unchanged.
Raises: any cause from boxing or appending an element.
Source: lib/typed-array.x:152
ArrayDbl.block
inline Block ArrayDbl.block(ArrayDbl array)
Views array as the same underlying Block storage.
Source: lib/typed-array.x:156
ArrayDbl.compare
int ArrayDbl.compare(ArrayDbl a, ArrayDbl b)
Compares packed Arrays lexicographically with the element family’s ordering. Identical handles compare equal and NULL sorts first.
Source: lib/typed-array.x:152
ArrayDbl.concat
Self ArrayDbl.concat(Self a, Self b)
Returns a fresh array holding a followed by b.
Neither input is modified. A null a returns NULL, while a null b
produces an independent copy of a.
Raises: <size-limit> or <alloc-fail> when the result cannot be
represented or allocated.
Source: lib/typed-array.x:151
ArrayDbl.contains
int ArrayDbl.contains(ArrayDbl array, double value)
Reports whether a native element equals value.
The scan is linear. Raises: <size-limit> when the length exceeds the
integer index domain.
Source: lib/typed-array.x:151
ArrayDbl.copy
Self ArrayDbl.copy(Self array)
Returns a fresh packed copy, or NULL for a null array. The result has independent mutable storage containing the same stored values.
Raises: <size-limit> or <alloc-fail> when the copy cannot be
represented or allocated.
Source: lib/typed-array.x:151
ArrayDbl.count
int ArrayDbl.count(ArrayDbl array, double value)
Returns how many native elements equal value.
A null array returns zero; the scan is linear.
Raises: <size-limit> when the length exceeds the integer index domain.
Source: lib/typed-array.x:151
ArrayDbl.equal
int ArrayDbl.equal(ArrayDbl a, ArrayDbl b)
Reports elementwise native equality. Two null arrays compare equal; one null array or different lengths compare unequal.
Source: lib/typed-array.x:151
ArrayDbl.find
int ArrayDbl.find(ArrayDbl array, double value)
Returns the first index whose native element equals value, or -1.
A null array returns -1; the scan is linear and preserves source order.
Raises: <size-limit> when the length exceeds the integer index domain.
Source: lib/typed-array.x:151
ArrayDbl.getindex
inline double ArrayDbl.getindex(ArrayDbl array, int index)
Returns the element at raw index with no bounds or null check.
Negative indices are not normalized, and an invalid index has the same
undefined behavior as indexing the equivalent C pointer.
Source: lib/typed-array.x:151
ArrayDbl.getslice
Self ArrayDbl.getslice(Self array, int start, int end, int step)
Returns a fresh packed array for normalized [start:end:step].
Negative bounds count from the end and a negative step walks backward.
Raises: <bad-arg> for a null array or zero step, <size-limit> outside
the integer index domain, or <alloc-fail> on allocation failure.
Source: lib/typed-array.x:151
ArrayDbl.indexof
int ArrayDbl.indexof(ArrayDbl array, double value)
Returns the same first-match index as ArrayDbl.find.
Source: lib/typed-array.x:151
ArrayDbl.insert
double ArrayDbl.insert(ArrayDbl array, int index, double value)
Inserts value at normalized index and returns it.
The accepted range includes the position after the last element;
negative indices are normalized against that wider range.
Raises: <bad-arg> for a null array or out-of-range index,
<size-limit> at the integer index limit, or <alloc-fail> when storage
cannot grow.
Source: lib/typed-array.x:151
ArrayDbl.iter
Iter ArrayDbl.iter(ArrayDbl array, Iter dest)
Initializes dest to lazily yield boxed elements in index order.
Returns dest, whose storage is caller-owned. The iterator borrows
array and reads its current storage on each step, so both must remain
live and mutation can change the remaining traversal. A null dest
returns NULL. A null array, or one longer than the integer index domain,
is exhausted. A boxed wide element is Scope-owned;
retaining one after a
pull requires its owning Scope to remain live.
Raises: any cause from boxing an element.
Source: lib/typed-array.x:156
ArrayDbl.new
ArrayDbl ArrayDbl.new(void)
Returns a fresh empty packed array owned by the current Scope.
Raises: <alloc-fail> when storage cannot be allocated.
Source: lib/typed-array.x:151
ArrayDbl.postfixindex
inline double ArrayDbl.postfixindex(ArrayDbl array, int index, Symbol op)
Applies ++ or -- at raw index and returns the previous value.
The index has the unchecked C-pointer preconditions of bracket access.
Raises: <bad-op> for another operator. The failure does not return.
Source: lib/typed-array.x:155
ArrayDbl.push
double ArrayDbl.push(ArrayDbl array, double value)
Appends value and returns it.
Raises: <bad-arg> for a null array, <size-limit> at the integer index
limit, or <alloc-fail> when storage cannot grow.
Source: lib/typed-array.x:151
ArrayDbl.remove
double ArrayDbl.remove(ArrayDbl array, int index)
Removes and returns the element at normalized index.
Negative indices count from the end; following elements shift left.
Raises: <bad-arg> for a null array or out-of-range index, or
<size-limit> when the length exceeds the integer index domain.
Source: lib/typed-array.x:151
ArrayDbl.remslice
Self ArrayDbl.remslice(Self array, int start, int end)
Removes normalized bounds [start:end] and returns a fresh packed array.
Reversed bounds are swapped, and the removed values retain their order.
Raises: <bad-arg> for a null array, <size-limit> outside the integer
index domain, or <alloc-fail> on allocation failure.
Source: lib/typed-array.x:151
ArrayDbl.repr
String ArrayDbl.repr(ArrayDbl array)
Returns the readable packed-Array representation.
Source: lib/typed-array.x:152
ArrayDbl.reverse
Self ArrayDbl.reverse(Self array)
Reverses array in place and returns that same array.
A null or one-element array is returned unchanged.
Source: lib/typed-array.x:151
ArrayDbl.setindex
inline double ArrayDbl.setindex(ArrayDbl array, int index, double value)
Stores and returns value at raw index with no bounds or null check.
Negative indices are not normalized, and an invalid index has the same
undefined behavior as indexing the equivalent C pointer.
Source: lib/typed-array.x:151
ArrayDbl.setslice
Self ArrayDbl.setslice(Self array, int start, int end, Self values)
Replaces normalized bounds [start:end] and returns array.
Reversed bounds are swapped; null values deletes the region. Passing
array itself as values is supported and copies before mutation.
Raises: <bad-arg> for a null array, <size-limit> outside the integer
index domain, or <alloc-fail> while copying self-aliased values or
growing storage for the replacement. These failures leave array
unchanged.
Source: lib/typed-array.x:151
ArrayDbl.shift
double ArrayDbl.shift(ArrayDbl array)
Removes and returns the first element, shifting the remainder left. This operation is O(n).
Raises: <bad-arg> for a null or empty array, or <size-limit> when the
length exceeds the integer index domain. These failures do not return.
Source: lib/typed-array.x:151
ArrayDbl.splice
Self ArrayDbl.splice(Self array, int index, int remove_count, Self values)
Replaces remove_count values at normalized index and returns them.
The result is a fresh packed array. A nonpositive count removes nothing;
null values performs deletion, and self-splicing is supported.
Raises: <bad-arg> for a null array, <size-limit> outside the integer
index domain, or <alloc-fail> on allocation failure.
Source: lib/typed-array.x:151
ArrayDbl.str
String ArrayDbl.str(ArrayDbl array)
Returns the packed-Array display String.
Source: lib/typed-array.x:152
ArrayDbl.take_last
double ArrayDbl.take_last(ArrayDbl array)
Removes and returns the last element.
Raises: <bad-arg> for a null or empty array.
Source: lib/typed-array.x:151
ArrayDbl.try_get
int ArrayDbl.try_get(ArrayDbl array, int index, double *out)
Reads normalized index into out and reports whether it exists.
Negative indices count from the end. A null array, null out, or
out-of-range index returns zero without writing; success returns one.
Raises: <size-limit> when the length exceeds the integer index domain.
Source: lib/typed-array.x:151
ArrayDbl.try_next
int ArrayDbl.try_next(ArrayDbl array, int *cursor, double *out)
Writes the next native element, advances cursor, and returns one.
Initialize the caller-owned cursor to zero. A null argument, negative
cursor, exhaustion, or an array outside the integer index domain returns
zero without changing cursor or out. Structural mutation invalidates
the cursor.
Source: lib/typed-array.x:151
ArrayDbl.try_take_last
int ArrayDbl.try_take_last(ArrayDbl array, double *out)
Removes the last element into out and returns one when present.
A null or empty array, or null out, returns zero without writing or
changing the array.
Source: lib/typed-array.x:151
ArrayDbl.unshift
double ArrayDbl.unshift(ArrayDbl array, double value)
Inserts value at the front and returns it, shifting elements right.
This operation is O(n).
Raises: <bad-arg> for a null array, <size-limit> at the integer index
limit, or <alloc-fail> when storage cannot grow.
Source: lib/typed-array.x:151
ArrayDbl.updateindex
inline double ArrayDbl.updateindex( ArrayDbl array, int index, Symbol op, double rhs)
Applies a floating arithmetic op and returns the stored value.
The supported operators are +, -, *, and /; the raw index has
the unchecked C-pointer preconditions of bracket access.
Raises: <bad-types> for another operator, before changing the element.
Source: lib/typed-array.x:155
ArrayDbl.var
inline Var ArrayDbl.var(ArrayDbl array)
Boxes array with its registered packed-array tag without copying.
The boxed and typed values share the same mutable object identity.
Source: lib/typed-array.x:156
ArrayDbl.write_repr
Buffer ArrayDbl.write_repr(ArrayDbl array, Buffer out)
Appends the readable packed-Array representation to out.
Source: lib/typed-array.x:152
ArrayDbl.write_str
Buffer ArrayDbl.write_str(ArrayDbl array, Buffer out)
Appends the packed-Array display text to out.
Source: lib/typed-array.x:152
ArrayFloat
ArrayFloat.array
Array ArrayFloat.array(ArrayFloat array)
Returns a fresh ordinary Array containing boxed elements in source order. A null input returns NULL. The typed Array and its storage are unchanged.
Raises: any cause from boxing or appending an element.
Source: lib/typed-array.x:143
ArrayFloat.block
inline Block ArrayFloat.block(ArrayFloat array)
Views array as the same underlying Block storage.
Source: lib/typed-array.x:147
ArrayFloat.compare
int ArrayFloat.compare(ArrayFloat a, ArrayFloat b)
Compares packed Arrays lexicographically with the element family’s ordering. Identical handles compare equal and NULL sorts first.
Source: lib/typed-array.x:143
ArrayFloat.concat
Self ArrayFloat.concat(Self a, Self b)
Returns a fresh array holding a followed by b.
Neither input is modified. A null a returns NULL, while a null b
produces an independent copy of a.
Raises: <size-limit> or <alloc-fail> when the result cannot be
represented or allocated.
Source: lib/typed-array.x:142
ArrayFloat.contains
int ArrayFloat.contains(ArrayFloat array, float value)
Reports whether a native element equals value.
The scan is linear. Raises: <size-limit> when the length exceeds the
integer index domain.
Source: lib/typed-array.x:142
ArrayFloat.copy
Self ArrayFloat.copy(Self array)
Returns a fresh packed copy, or NULL for a null array. The result has independent mutable storage containing the same stored values.
Raises: <size-limit> or <alloc-fail> when the copy cannot be
represented or allocated.
Source: lib/typed-array.x:142
ArrayFloat.count
int ArrayFloat.count(ArrayFloat array, float value)
Returns how many native elements equal value.
A null array returns zero; the scan is linear.
Raises: <size-limit> when the length exceeds the integer index domain.
Source: lib/typed-array.x:142
ArrayFloat.equal
int ArrayFloat.equal(ArrayFloat a, ArrayFloat b)
Reports elementwise native equality. Two null arrays compare equal; one null array or different lengths compare unequal.
Source: lib/typed-array.x:142
ArrayFloat.find
int ArrayFloat.find(ArrayFloat array, float value)
Returns the first index whose native element equals value, or -1.
A null array returns -1; the scan is linear and preserves source order.
Raises: <size-limit> when the length exceeds the integer index domain.
Source: lib/typed-array.x:142
ArrayFloat.getindex
inline float ArrayFloat.getindex(ArrayFloat array, int index)
Returns the element at raw index with no bounds or null check.
Negative indices are not normalized, and an invalid index has the same
undefined behavior as indexing the equivalent C pointer.
Source: lib/typed-array.x:142
ArrayFloat.getslice
Self ArrayFloat.getslice(Self array, int start, int end, int step)
Returns a fresh packed array for normalized [start:end:step].
Negative bounds count from the end and a negative step walks backward.
Raises: <bad-arg> for a null array or zero step, <size-limit> outside
the integer index domain, or <alloc-fail> on allocation failure.
Source: lib/typed-array.x:142
ArrayFloat.indexof
int ArrayFloat.indexof(ArrayFloat array, float value)
Returns the same first-match index as ArrayFloat.find.
Source: lib/typed-array.x:142
ArrayFloat.insert
float ArrayFloat.insert(ArrayFloat array, int index, float value)
Inserts value at normalized index and returns it.
The accepted range includes the position after the last element;
negative indices are normalized against that wider range.
Raises: <bad-arg> for a null array or out-of-range index,
<size-limit> at the integer index limit, or <alloc-fail> when storage
cannot grow.
Source: lib/typed-array.x:142
ArrayFloat.iter
Iter ArrayFloat.iter(ArrayFloat array, Iter dest)
Initializes dest to lazily yield boxed elements in index order.
Returns dest, whose storage is caller-owned. The iterator borrows
array and reads its current storage on each step, so both must remain
live and mutation can change the remaining traversal. A null dest
returns NULL. A null array, or one longer than the integer index domain,
is exhausted. A boxed wide element is Scope-owned;
retaining one after a
pull requires its owning Scope to remain live.
Raises: any cause from boxing an element.
Source: lib/typed-array.x:147
ArrayFloat.new
ArrayFloat ArrayFloat.new(void)
Returns a fresh empty packed array owned by the current Scope.
Raises: <alloc-fail> when storage cannot be allocated.
Source: lib/typed-array.x:142
ArrayFloat.postfixindex
inline float ArrayFloat.postfixindex(ArrayFloat array, int index, Symbol op)
Applies ++ or -- at raw index and returns the previous value.
The index has the unchecked C-pointer preconditions of bracket access.
Raises: <bad-op> for another operator. The failure does not return.
Source: lib/typed-array.x:146
ArrayFloat.push
float ArrayFloat.push(ArrayFloat array, float value)
Appends value and returns it.
Raises: <bad-arg> for a null array, <size-limit> at the integer index
limit, or <alloc-fail> when storage cannot grow.
Source: lib/typed-array.x:142
ArrayFloat.remove
float ArrayFloat.remove(ArrayFloat array, int index)
Removes and returns the element at normalized index.
Negative indices count from the end; following elements shift left.
Raises: <bad-arg> for a null array or out-of-range index, or
<size-limit> when the length exceeds the integer index domain.
Source: lib/typed-array.x:142
ArrayFloat.remslice
Self ArrayFloat.remslice(Self array, int start, int end)
Removes normalized bounds [start:end] and returns a fresh packed array.
Reversed bounds are swapped, and the removed values retain their order.
Raises: <bad-arg> for a null array, <size-limit> outside the integer
index domain, or <alloc-fail> on allocation failure.
Source: lib/typed-array.x:142
ArrayFloat.repr
String ArrayFloat.repr(ArrayFloat array)
Returns the readable packed-Array representation.
Source: lib/typed-array.x:143
ArrayFloat.reverse
Self ArrayFloat.reverse(Self array)
Reverses array in place and returns that same array.
A null or one-element array is returned unchanged.
Source: lib/typed-array.x:142
ArrayFloat.setindex
inline float ArrayFloat.setindex(ArrayFloat array, int index, float value)
Stores and returns value at raw index with no bounds or null check.
Negative indices are not normalized, and an invalid index has the same
undefined behavior as indexing the equivalent C pointer.
Source: lib/typed-array.x:142
ArrayFloat.setslice
Self ArrayFloat.setslice(Self array, int start, int end, Self values)
Replaces normalized bounds [start:end] and returns array.
Reversed bounds are swapped; null values deletes the region. Passing
array itself as values is supported and copies before mutation.
Raises: <bad-arg> for a null array, <size-limit> outside the integer
index domain, or <alloc-fail> while copying self-aliased values or
growing storage for the replacement. These failures leave array
unchanged.
Source: lib/typed-array.x:142
ArrayFloat.shift
float ArrayFloat.shift(ArrayFloat array)
Removes and returns the first element, shifting the remainder left. This operation is O(n).
Raises: <bad-arg> for a null or empty array, or <size-limit> when the
length exceeds the integer index domain. These failures do not return.
Source: lib/typed-array.x:142
ArrayFloat.splice
Self ArrayFloat.splice(Self array, int index, int remove_count, Self values)
Replaces remove_count values at normalized index and returns them.
The result is a fresh packed array. A nonpositive count removes nothing;
null values performs deletion, and self-splicing is supported.
Raises: <bad-arg> for a null array, <size-limit> outside the integer
index domain, or <alloc-fail> on allocation failure.
Source: lib/typed-array.x:142
ArrayFloat.str
String ArrayFloat.str(ArrayFloat array)
Returns the packed-Array display String.
Source: lib/typed-array.x:143
ArrayFloat.take_last
float ArrayFloat.take_last(ArrayFloat array)
Removes and returns the last element.
Raises: <bad-arg> for a null or empty array.
Source: lib/typed-array.x:142
ArrayFloat.try_get
int ArrayFloat.try_get(ArrayFloat array, int index, float *out)
Reads normalized index into out and reports whether it exists.
Negative indices count from the end. A null array, null out, or
out-of-range index returns zero without writing; success returns one.
Raises: <size-limit> when the length exceeds the integer index domain.
Source: lib/typed-array.x:142
ArrayFloat.try_next
int ArrayFloat.try_next(ArrayFloat array, int *cursor, float *out)
Writes the next native element, advances cursor, and returns one.
Initialize the caller-owned cursor to zero. A null argument, negative
cursor, exhaustion, or an array outside the integer index domain returns
zero without changing cursor or out. Structural mutation invalidates
the cursor.
Source: lib/typed-array.x:142
ArrayFloat.try_take_last
int ArrayFloat.try_take_last(ArrayFloat array, float *out)
Removes the last element into out and returns one when present.
A null or empty array, or null out, returns zero without writing or
changing the array.
Source: lib/typed-array.x:142
ArrayFloat.unshift
float ArrayFloat.unshift(ArrayFloat array, float value)
Inserts value at the front and returns it, shifting elements right.
This operation is O(n).
Raises: <bad-arg> for a null array, <size-limit> at the integer index
limit, or <alloc-fail> when storage cannot grow.
Source: lib/typed-array.x:142
ArrayFloat.updateindex
inline float ArrayFloat.updateindex( ArrayFloat array, int index, Symbol op, float rhs)
Applies a floating arithmetic op and returns the stored value.
The supported operators are +, -, *, and /; the raw index has
the unchecked C-pointer preconditions of bracket access.
Raises: <bad-types> for another operator, before changing the element.
Source: lib/typed-array.x:146
ArrayFloat.var
inline Var ArrayFloat.var(ArrayFloat array)
Boxes array with its registered packed-array tag without copying.
The boxed and typed values share the same mutable object identity.
Source: lib/typed-array.x:147
ArrayFloat.write_repr
Buffer ArrayFloat.write_repr(ArrayFloat array, Buffer out)
Appends the readable packed-Array representation to out.
Source: lib/typed-array.x:143
ArrayFloat.write_str
Buffer ArrayFloat.write_str(ArrayFloat array, Buffer out)
Appends the packed-Array display text to out.
Source: lib/typed-array.x:143
ArrayInt
ArrayInt.array
Array ArrayInt.array(ArrayInt array)
Returns a fresh ordinary Array containing boxed elements in source order. A null input returns NULL. The typed Array and its storage are unchanged.
Raises: any cause from boxing or appending an element.
Source: lib/typed-array.x:125
ArrayInt.block
inline Block ArrayInt.block(ArrayInt array)
Views array as the same underlying Block storage.
Source: lib/typed-array.x:129
ArrayInt.compare
int ArrayInt.compare(ArrayInt a, ArrayInt b)
Compares packed Arrays lexicographically with the element family’s ordering. Identical handles compare equal and NULL sorts first.
Source: lib/typed-array.x:125
ArrayInt.concat
Self ArrayInt.concat(Self a, Self b)
Returns a fresh array holding a followed by b.
Neither input is modified. A null a returns NULL, while a null b
produces an independent copy of a.
Raises: <size-limit> or <alloc-fail> when the result cannot be
represented or allocated.
Source: lib/typed-array.x:124
ArrayInt.contains
int ArrayInt.contains(ArrayInt array, int value)
Reports whether a native element equals value.
The scan is linear. Raises: <size-limit> when the length exceeds the
integer index domain.
Source: lib/typed-array.x:124
ArrayInt.copy
Self ArrayInt.copy(Self array)
Returns a fresh packed copy, or NULL for a null array. The result has independent mutable storage containing the same stored values.
Raises: <size-limit> or <alloc-fail> when the copy cannot be
represented or allocated.
Source: lib/typed-array.x:124
ArrayInt.count
int ArrayInt.count(ArrayInt array, int value)
Returns how many native elements equal value.
A null array returns zero; the scan is linear.
Raises: <size-limit> when the length exceeds the integer index domain.
Source: lib/typed-array.x:124
ArrayInt.equal
int ArrayInt.equal(ArrayInt a, ArrayInt b)
Reports elementwise native equality. Two null arrays compare equal; one null array or different lengths compare unequal.
Source: lib/typed-array.x:124
ArrayInt.find
int ArrayInt.find(ArrayInt array, int value)
Returns the first index whose native element equals value, or -1.
A null array returns -1; the scan is linear and preserves source order.
Raises: <size-limit> when the length exceeds the integer index domain.
Source: lib/typed-array.x:124
ArrayInt.getindex
inline int ArrayInt.getindex(ArrayInt array, int index)
Returns the element at raw index with no bounds or null check.
Negative indices are not normalized, and an invalid index has the same
undefined behavior as indexing the equivalent C pointer.
Source: lib/typed-array.x:124
ArrayInt.getslice
Self ArrayInt.getslice(Self array, int start, int end, int step)
Returns a fresh packed array for normalized [start:end:step].
Negative bounds count from the end and a negative step walks backward.
Raises: <bad-arg> for a null array or zero step, <size-limit> outside
the integer index domain, or <alloc-fail> on allocation failure.
Source: lib/typed-array.x:124
ArrayInt.indexof
int ArrayInt.indexof(ArrayInt array, int value)
Returns the same first-match index as ArrayInt.find.
Source: lib/typed-array.x:124
ArrayInt.insert
int ArrayInt.insert(ArrayInt array, int index, int value)
Inserts value at normalized index and returns it.
The accepted range includes the position after the last element;
negative indices are normalized against that wider range.
Raises: <bad-arg> for a null array or out-of-range index,
<size-limit> at the integer index limit, or <alloc-fail> when storage
cannot grow.
Source: lib/typed-array.x:124
ArrayInt.iter
Iter ArrayInt.iter(ArrayInt array, Iter dest)
Initializes dest to lazily yield boxed elements in index order.
Returns dest, whose storage is caller-owned. The iterator borrows
array and reads its current storage on each step, so both must remain
live and mutation can change the remaining traversal. A null dest
returns NULL. A null array, or one longer than the integer index domain,
is exhausted. A boxed wide element is Scope-owned;
retaining one after a
pull requires its owning Scope to remain live.
Raises: any cause from boxing an element.
Source: lib/typed-array.x:129
ArrayInt.new
ArrayInt ArrayInt.new(void)
Returns a fresh empty packed array owned by the current Scope.
Raises: <alloc-fail> when storage cannot be allocated.
Source: lib/typed-array.x:124
ArrayInt.postfixindex
inline int ArrayInt.postfixindex(ArrayInt array, int index, Symbol op)
Applies ++ or -- at raw index and returns the previous value.
The index has the unchecked C-pointer preconditions of bracket access.
Raises: <bad-op> for another operator. The failure does not return.
Source: lib/typed-array.x:128
ArrayInt.push
int ArrayInt.push(ArrayInt array, int value)
Appends value and returns it.
Raises: <bad-arg> for a null array, <size-limit> at the integer index
limit, or <alloc-fail> when storage cannot grow.
Source: lib/typed-array.x:124
ArrayInt.remove
int ArrayInt.remove(ArrayInt array, int index)
Removes and returns the element at normalized index.
Negative indices count from the end; following elements shift left.
Raises: <bad-arg> for a null array or out-of-range index, or
<size-limit> when the length exceeds the integer index domain.
Source: lib/typed-array.x:124
ArrayInt.remslice
Self ArrayInt.remslice(Self array, int start, int end)
Removes normalized bounds [start:end] and returns a fresh packed array.
Reversed bounds are swapped, and the removed values retain their order.
Raises: <bad-arg> for a null array, <size-limit> outside the integer
index domain, or <alloc-fail> on allocation failure.
Source: lib/typed-array.x:124
ArrayInt.repr
String ArrayInt.repr(ArrayInt array)
Returns the readable packed-Array representation.
Source: lib/typed-array.x:125
ArrayInt.reverse
Self ArrayInt.reverse(Self array)
Reverses array in place and returns that same array.
A null or one-element array is returned unchanged.
Source: lib/typed-array.x:124
ArrayInt.setindex
inline int ArrayInt.setindex(ArrayInt array, int index, int value)
Stores and returns value at raw index with no bounds or null check.
Negative indices are not normalized, and an invalid index has the same
undefined behavior as indexing the equivalent C pointer.
Source: lib/typed-array.x:124
ArrayInt.setslice
Self ArrayInt.setslice(Self array, int start, int end, Self values)
Replaces normalized bounds [start:end] and returns array.
Reversed bounds are swapped; null values deletes the region. Passing
array itself as values is supported and copies before mutation.
Raises: <bad-arg> for a null array, <size-limit> outside the integer
index domain, or <alloc-fail> while copying self-aliased values or
growing storage for the replacement. These failures leave array
unchanged.
Source: lib/typed-array.x:124
ArrayInt.shift
int ArrayInt.shift(ArrayInt array)
Removes and returns the first element, shifting the remainder left. This operation is O(n).
Raises: <bad-arg> for a null or empty array, or <size-limit> when the
length exceeds the integer index domain. These failures do not return.
Source: lib/typed-array.x:124
ArrayInt.splice
Self ArrayInt.splice(Self array, int index, int remove_count, Self values)
Replaces remove_count values at normalized index and returns them.
The result is a fresh packed array. A nonpositive count removes nothing;
null values performs deletion, and self-splicing is supported.
Raises: <bad-arg> for a null array, <size-limit> outside the integer
index domain, or <alloc-fail> on allocation failure.
Source: lib/typed-array.x:124
ArrayInt.str
String ArrayInt.str(ArrayInt array)
Returns the packed-Array display String.
Source: lib/typed-array.x:125
ArrayInt.take_last
int ArrayInt.take_last(ArrayInt array)
Removes and returns the last element.
Raises: <bad-arg> for a null or empty array.
Source: lib/typed-array.x:124
ArrayInt.try_get
int ArrayInt.try_get(ArrayInt array, int index, int *out)
Reads normalized index into out and reports whether it exists.
Negative indices count from the end. A null array, null out, or
out-of-range index returns zero without writing; success returns one.
Raises: <size-limit> when the length exceeds the integer index domain.
Source: lib/typed-array.x:124
ArrayInt.try_next
int ArrayInt.try_next(ArrayInt array, int *cursor, int *out)
Writes the next native element, advances cursor, and returns one.
Initialize the caller-owned cursor to zero. A null argument, negative
cursor, exhaustion, or an array outside the integer index domain returns
zero without changing cursor or out. Structural mutation invalidates
the cursor.
Source: lib/typed-array.x:124
ArrayInt.try_take_last
int ArrayInt.try_take_last(ArrayInt array, int *out)
Removes the last element into out and returns one when present.
A null or empty array, or null out, returns zero without writing or
changing the array.
Source: lib/typed-array.x:124
ArrayInt.unshift
int ArrayInt.unshift(ArrayInt array, int value)
Inserts value at the front and returns it, shifting elements right.
This operation is O(n).
Raises: <bad-arg> for a null array, <size-limit> at the integer index
limit, or <alloc-fail> when storage cannot grow.
Source: lib/typed-array.x:124
ArrayInt.updateindex
inline int ArrayInt.updateindex( ArrayInt array, int index, Symbol op, int rhs)
Applies integer op to raw element index and returns the stored value.
The index has the unchecked C-pointer preconditions of bracket access.
Arithmetic follows the generated C operators, integer promotions, and
result conversion. A failing operation leaves the element unchanged.
Raises: <div-zero>, <bad-shift>, or <bad-op> for its corresponding
invalid operation.
Source: lib/typed-array.x:128
ArrayInt.var
inline Var ArrayInt.var(ArrayInt array)
Boxes array with its registered packed-array tag without copying.
The boxed and typed values share the same mutable object identity.
Source: lib/typed-array.x:129
ArrayInt.write_repr
Buffer ArrayInt.write_repr(ArrayInt array, Buffer out)
Appends the readable packed-Array representation to out.
Source: lib/typed-array.x:125
ArrayInt.write_str
Buffer ArrayInt.write_str(ArrayInt array, Buffer out)
Appends the packed-Array display text to out.
Source: lib/typed-array.x:125
ArrayLong
ArrayLong.array
Array ArrayLong.array(ArrayLong array)
Returns a fresh ordinary Array containing boxed elements in source order. A null input returns NULL. The typed Array and its storage are unchanged.
Raises: any cause from boxing or appending an element.
Source: lib/typed-array.x:134
ArrayLong.block
inline Block ArrayLong.block(ArrayLong array)
Views array as the same underlying Block storage.
Source: lib/typed-array.x:138
ArrayLong.compare
int ArrayLong.compare(ArrayLong a, ArrayLong b)
Compares packed Arrays lexicographically with the element family’s ordering. Identical handles compare equal and NULL sorts first.
Source: lib/typed-array.x:134
ArrayLong.concat
Self ArrayLong.concat(Self a, Self b)
Returns a fresh array holding a followed by b.
Neither input is modified. A null a returns NULL, while a null b
produces an independent copy of a.
Raises: <size-limit> or <alloc-fail> when the result cannot be
represented or allocated.
Source: lib/typed-array.x:133
ArrayLong.contains
int ArrayLong.contains(ArrayLong array, long value)
Reports whether a native element equals value.
The scan is linear. Raises: <size-limit> when the length exceeds the
integer index domain.
Source: lib/typed-array.x:133
ArrayLong.copy
Self ArrayLong.copy(Self array)
Returns a fresh packed copy, or NULL for a null array. The result has independent mutable storage containing the same stored values.
Raises: <size-limit> or <alloc-fail> when the copy cannot be
represented or allocated.
Source: lib/typed-array.x:133
ArrayLong.count
int ArrayLong.count(ArrayLong array, long value)
Returns how many native elements equal value.
A null array returns zero; the scan is linear.
Raises: <size-limit> when the length exceeds the integer index domain.
Source: lib/typed-array.x:133
ArrayLong.equal
int ArrayLong.equal(ArrayLong a, ArrayLong b)
Reports elementwise native equality. Two null arrays compare equal; one null array or different lengths compare unequal.
Source: lib/typed-array.x:133
ArrayLong.find
int ArrayLong.find(ArrayLong array, long value)
Returns the first index whose native element equals value, or -1.
A null array returns -1; the scan is linear and preserves source order.
Raises: <size-limit> when the length exceeds the integer index domain.
Source: lib/typed-array.x:133
ArrayLong.getindex
inline long ArrayLong.getindex(ArrayLong array, int index)
Returns the element at raw index with no bounds or null check.
Negative indices are not normalized, and an invalid index has the same
undefined behavior as indexing the equivalent C pointer.
Source: lib/typed-array.x:133
ArrayLong.getslice
Self ArrayLong.getslice(Self array, int start, int end, int step)
Returns a fresh packed array for normalized [start:end:step].
Negative bounds count from the end and a negative step walks backward.
Raises: <bad-arg> for a null array or zero step, <size-limit> outside
the integer index domain, or <alloc-fail> on allocation failure.
Source: lib/typed-array.x:133
ArrayLong.indexof
int ArrayLong.indexof(ArrayLong array, long value)
Returns the same first-match index as ArrayLong.find.
Source: lib/typed-array.x:133
ArrayLong.insert
long ArrayLong.insert(ArrayLong array, int index, long value)
Inserts value at normalized index and returns it.
The accepted range includes the position after the last element;
negative indices are normalized against that wider range.
Raises: <bad-arg> for a null array or out-of-range index,
<size-limit> at the integer index limit, or <alloc-fail> when storage
cannot grow.
Source: lib/typed-array.x:133
ArrayLong.iter
Iter ArrayLong.iter(ArrayLong array, Iter dest)
Initializes dest to lazily yield boxed elements in index order.
Returns dest, whose storage is caller-owned. The iterator borrows
array and reads its current storage on each step, so both must remain
live and mutation can change the remaining traversal. A null dest
returns NULL. A null array, or one longer than the integer index domain,
is exhausted. A boxed wide element is Scope-owned;
retaining one after a
pull requires its owning Scope to remain live.
Raises: any cause from boxing an element.
Source: lib/typed-array.x:138
ArrayLong.new
ArrayLong ArrayLong.new(void)
Returns a fresh empty packed array owned by the current Scope.
Raises: <alloc-fail> when storage cannot be allocated.
Source: lib/typed-array.x:133
ArrayLong.postfixindex
inline long ArrayLong.postfixindex(ArrayLong array, int index, Symbol op)
Applies ++ or -- at raw index and returns the previous value.
The index has the unchecked C-pointer preconditions of bracket access.
Raises: <bad-op> for another operator. The failure does not return.
Source: lib/typed-array.x:137
ArrayLong.push
long ArrayLong.push(ArrayLong array, long value)
Appends value and returns it.
Raises: <bad-arg> for a null array, <size-limit> at the integer index
limit, or <alloc-fail> when storage cannot grow.
Source: lib/typed-array.x:133
ArrayLong.remove
long ArrayLong.remove(ArrayLong array, int index)
Removes and returns the element at normalized index.
Negative indices count from the end; following elements shift left.
Raises: <bad-arg> for a null array or out-of-range index, or
<size-limit> when the length exceeds the integer index domain.
Source: lib/typed-array.x:133
ArrayLong.remslice
Self ArrayLong.remslice(Self array, int start, int end)
Removes normalized bounds [start:end] and returns a fresh packed array.
Reversed bounds are swapped, and the removed values retain their order.
Raises: <bad-arg> for a null array, <size-limit> outside the integer
index domain, or <alloc-fail> on allocation failure.
Source: lib/typed-array.x:133
ArrayLong.repr
String ArrayLong.repr(ArrayLong array)
Returns the readable packed-Array representation.
Source: lib/typed-array.x:134
ArrayLong.reverse
Self ArrayLong.reverse(Self array)
Reverses array in place and returns that same array.
A null or one-element array is returned unchanged.
Source: lib/typed-array.x:133
ArrayLong.setindex
inline long ArrayLong.setindex(ArrayLong array, int index, long value)
Stores and returns value at raw index with no bounds or null check.
Negative indices are not normalized, and an invalid index has the same
undefined behavior as indexing the equivalent C pointer.
Source: lib/typed-array.x:133
ArrayLong.setslice
Self ArrayLong.setslice(Self array, int start, int end, Self values)
Replaces normalized bounds [start:end] and returns array.
Reversed bounds are swapped; null values deletes the region. Passing
array itself as values is supported and copies before mutation.
Raises: <bad-arg> for a null array, <size-limit> outside the integer
index domain, or <alloc-fail> while copying self-aliased values or
growing storage for the replacement. These failures leave array
unchanged.
Source: lib/typed-array.x:133
ArrayLong.shift
long ArrayLong.shift(ArrayLong array)
Removes and returns the first element, shifting the remainder left. This operation is O(n).
Raises: <bad-arg> for a null or empty array, or <size-limit> when the
length exceeds the integer index domain. These failures do not return.
Source: lib/typed-array.x:133
ArrayLong.splice
Self ArrayLong.splice(Self array, int index, int remove_count, Self values)
Replaces remove_count values at normalized index and returns them.
The result is a fresh packed array. A nonpositive count removes nothing;
null values performs deletion, and self-splicing is supported.
Raises: <bad-arg> for a null array, <size-limit> outside the integer
index domain, or <alloc-fail> on allocation failure.
Source: lib/typed-array.x:133
ArrayLong.str
String ArrayLong.str(ArrayLong array)
Returns the packed-Array display String.
Source: lib/typed-array.x:134
ArrayLong.take_last
long ArrayLong.take_last(ArrayLong array)
Removes and returns the last element.
Raises: <bad-arg> for a null or empty array.
Source: lib/typed-array.x:133
ArrayLong.try_get
int ArrayLong.try_get(ArrayLong array, int index, long *out)
Reads normalized index into out and reports whether it exists.
Negative indices count from the end. A null array, null out, or
out-of-range index returns zero without writing; success returns one.
Raises: <size-limit> when the length exceeds the integer index domain.
Source: lib/typed-array.x:133
ArrayLong.try_next
int ArrayLong.try_next(ArrayLong array, int *cursor, long *out)
Writes the next native element, advances cursor, and returns one.
Initialize the caller-owned cursor to zero. A null argument, negative
cursor, exhaustion, or an array outside the integer index domain returns
zero without changing cursor or out. Structural mutation invalidates
the cursor.
Source: lib/typed-array.x:133
ArrayLong.try_take_last
int ArrayLong.try_take_last(ArrayLong array, long *out)
Removes the last element into out and returns one when present.
A null or empty array, or null out, returns zero without writing or
changing the array.
Source: lib/typed-array.x:133
ArrayLong.unshift
long ArrayLong.unshift(ArrayLong array, long value)
Inserts value at the front and returns it, shifting elements right.
This operation is O(n).
Raises: <bad-arg> for a null array, <size-limit> at the integer index
limit, or <alloc-fail> when storage cannot grow.
Source: lib/typed-array.x:133
ArrayLong.updateindex
inline long ArrayLong.updateindex( ArrayLong array, int index, Symbol op, long rhs)
Applies integer op to raw element index and returns the stored value.
The index has the unchecked C-pointer preconditions of bracket access.
Arithmetic follows the generated C operators, integer promotions, and
result conversion. A failing operation leaves the element unchanged.
Raises: <div-zero>, <bad-shift>, or <bad-op> for its corresponding
invalid operation.
Source: lib/typed-array.x:137
ArrayLong.var
inline Var ArrayLong.var(ArrayLong array)
Boxes array with its registered packed-array tag without copying.
The boxed and typed values share the same mutable object identity.
Source: lib/typed-array.x:138
ArrayLong.write_repr
Buffer ArrayLong.write_repr(ArrayLong array, Buffer out)
Appends the readable packed-Array representation to out.
Source: lib/typed-array.x:134
ArrayLong.write_str
Buffer ArrayLong.write_str(ArrayLong array, Buffer out)
Appends the packed-Array display text to out.
Source: lib/typed-array.x:134
ArrayShort
ArrayShort.array
Array ArrayShort.array(ArrayShort array)
Returns a fresh ordinary Array containing boxed elements in source order. A null input returns NULL. The typed Array and its storage are unchanged.
Raises: any cause from boxing or appending an element.
Source: lib/typed-array.x:116
ArrayShort.block
inline Block ArrayShort.block(ArrayShort array)
Views array as the same underlying Block storage.
Source: lib/typed-array.x:120
ArrayShort.compare
int ArrayShort.compare(ArrayShort a, ArrayShort b)
Compares packed Arrays lexicographically with the element family’s ordering. Identical handles compare equal and NULL sorts first.
Source: lib/typed-array.x:116
ArrayShort.concat
Self ArrayShort.concat(Self a, Self b)
Returns a fresh array holding a followed by b.
Neither input is modified. A null a returns NULL, while a null b
produces an independent copy of a.
Raises: <size-limit> or <alloc-fail> when the result cannot be
represented or allocated.
Source: lib/typed-array.x:115
ArrayShort.contains
int ArrayShort.contains(ArrayShort array, short value)
Reports whether a native element equals value.
The scan is linear. Raises: <size-limit> when the length exceeds the
integer index domain.
Source: lib/typed-array.x:115
ArrayShort.copy
Self ArrayShort.copy(Self array)
Returns a fresh packed copy, or NULL for a null array. The result has independent mutable storage containing the same stored values.
Raises: <size-limit> or <alloc-fail> when the copy cannot be
represented or allocated.
Source: lib/typed-array.x:115
ArrayShort.count
int ArrayShort.count(ArrayShort array, short value)
Returns how many native elements equal value.
A null array returns zero; the scan is linear.
Raises: <size-limit> when the length exceeds the integer index domain.
Source: lib/typed-array.x:115
ArrayShort.equal
int ArrayShort.equal(ArrayShort a, ArrayShort b)
Reports elementwise native equality. Two null arrays compare equal; one null array or different lengths compare unequal.
Source: lib/typed-array.x:115
ArrayShort.find
int ArrayShort.find(ArrayShort array, short value)
Returns the first index whose native element equals value, or -1.
A null array returns -1; the scan is linear and preserves source order.
Raises: <size-limit> when the length exceeds the integer index domain.
Source: lib/typed-array.x:115
ArrayShort.getindex
inline short ArrayShort.getindex(ArrayShort array, int index)
Returns the element at raw index with no bounds or null check.
Negative indices are not normalized, and an invalid index has the same
undefined behavior as indexing the equivalent C pointer.
Source: lib/typed-array.x:115
ArrayShort.getslice
Self ArrayShort.getslice(Self array, int start, int end, int step)
Returns a fresh packed array for normalized [start:end:step].
Negative bounds count from the end and a negative step walks backward.
Raises: <bad-arg> for a null array or zero step, <size-limit> outside
the integer index domain, or <alloc-fail> on allocation failure.
Source: lib/typed-array.x:115
ArrayShort.indexof
int ArrayShort.indexof(ArrayShort array, short value)
Returns the same first-match index as ArrayShort.find.
Source: lib/typed-array.x:115
ArrayShort.insert
short ArrayShort.insert(ArrayShort array, int index, short value)
Inserts value at normalized index and returns it.
The accepted range includes the position after the last element;
negative indices are normalized against that wider range.
Raises: <bad-arg> for a null array or out-of-range index,
<size-limit> at the integer index limit, or <alloc-fail> when storage
cannot grow.
Source: lib/typed-array.x:115
ArrayShort.iter
Iter ArrayShort.iter(ArrayShort array, Iter dest)
Initializes dest to lazily yield boxed elements in index order.
Returns dest, whose storage is caller-owned. The iterator borrows
array and reads its current storage on each step, so both must remain
live and mutation can change the remaining traversal. A null dest
returns NULL. A null array, or one longer than the integer index domain,
is exhausted. A boxed wide element is Scope-owned;
retaining one after a
pull requires its owning Scope to remain live.
Raises: any cause from boxing an element.
Source: lib/typed-array.x:120
ArrayShort.new
ArrayShort ArrayShort.new(void)
Returns a fresh empty packed array owned by the current Scope.
Raises: <alloc-fail> when storage cannot be allocated.
Source: lib/typed-array.x:115
ArrayShort.postfixindex
inline short ArrayShort.postfixindex(ArrayShort array, int index, Symbol op)
Applies ++ or -- at raw index and returns the previous value.
The index has the unchecked C-pointer preconditions of bracket access.
Raises: <bad-op> for another operator. The failure does not return.
Source: lib/typed-array.x:119
ArrayShort.push
short ArrayShort.push(ArrayShort array, short value)
Appends value and returns it.
Raises: <bad-arg> for a null array, <size-limit> at the integer index
limit, or <alloc-fail> when storage cannot grow.
Source: lib/typed-array.x:115
ArrayShort.remove
short ArrayShort.remove(ArrayShort array, int index)
Removes and returns the element at normalized index.
Negative indices count from the end; following elements shift left.
Raises: <bad-arg> for a null array or out-of-range index, or
<size-limit> when the length exceeds the integer index domain.
Source: lib/typed-array.x:115
ArrayShort.remslice
Self ArrayShort.remslice(Self array, int start, int end)
Removes normalized bounds [start:end] and returns a fresh packed array.
Reversed bounds are swapped, and the removed values retain their order.
Raises: <bad-arg> for a null array, <size-limit> outside the integer
index domain, or <alloc-fail> on allocation failure.
Source: lib/typed-array.x:115
ArrayShort.repr
String ArrayShort.repr(ArrayShort array)
Returns the readable packed-Array representation.
Source: lib/typed-array.x:116
ArrayShort.reverse
Self ArrayShort.reverse(Self array)
Reverses array in place and returns that same array.
A null or one-element array is returned unchanged.
Source: lib/typed-array.x:115
ArrayShort.setindex
inline short ArrayShort.setindex(ArrayShort array, int index, short value)
Stores and returns value at raw index with no bounds or null check.
Negative indices are not normalized, and an invalid index has the same
undefined behavior as indexing the equivalent C pointer.
Source: lib/typed-array.x:115
ArrayShort.setslice
Self ArrayShort.setslice(Self array, int start, int end, Self values)
Replaces normalized bounds [start:end] and returns array.
Reversed bounds are swapped; null values deletes the region. Passing
array itself as values is supported and copies before mutation.
Raises: <bad-arg> for a null array, <size-limit> outside the integer
index domain, or <alloc-fail> while copying self-aliased values or
growing storage for the replacement. These failures leave array
unchanged.
Source: lib/typed-array.x:115
ArrayShort.shift
short ArrayShort.shift(ArrayShort array)
Removes and returns the first element, shifting the remainder left. This operation is O(n).
Raises: <bad-arg> for a null or empty array, or <size-limit> when the
length exceeds the integer index domain. These failures do not return.
Source: lib/typed-array.x:115
ArrayShort.splice
Self ArrayShort.splice(Self array, int index, int remove_count, Self values)
Replaces remove_count values at normalized index and returns them.
The result is a fresh packed array. A nonpositive count removes nothing;
null values performs deletion, and self-splicing is supported.
Raises: <bad-arg> for a null array, <size-limit> outside the integer
index domain, or <alloc-fail> on allocation failure.
Source: lib/typed-array.x:115
ArrayShort.str
String ArrayShort.str(ArrayShort array)
Returns the packed-Array display String.
Source: lib/typed-array.x:116
ArrayShort.take_last
short ArrayShort.take_last(ArrayShort array)
Removes and returns the last element.
Raises: <bad-arg> for a null or empty array.
Source: lib/typed-array.x:115
ArrayShort.try_get
int ArrayShort.try_get(ArrayShort array, int index, short *out)
Reads normalized index into out and reports whether it exists.
Negative indices count from the end. A null array, null out, or
out-of-range index returns zero without writing; success returns one.
Raises: <size-limit> when the length exceeds the integer index domain.
Source: lib/typed-array.x:115
ArrayShort.try_next
int ArrayShort.try_next(ArrayShort array, int *cursor, short *out)
Writes the next native element, advances cursor, and returns one.
Initialize the caller-owned cursor to zero. A null argument, negative
cursor, exhaustion, or an array outside the integer index domain returns
zero without changing cursor or out. Structural mutation invalidates
the cursor.
Source: lib/typed-array.x:115
ArrayShort.try_take_last
int ArrayShort.try_take_last(ArrayShort array, short *out)
Removes the last element into out and returns one when present.
A null or empty array, or null out, returns zero without writing or
changing the array.
Source: lib/typed-array.x:115
ArrayShort.unshift
short ArrayShort.unshift(ArrayShort array, short value)
Inserts value at the front and returns it, shifting elements right.
This operation is O(n).
Raises: <bad-arg> for a null array, <size-limit> at the integer index
limit, or <alloc-fail> when storage cannot grow.
Source: lib/typed-array.x:115
ArrayShort.updateindex
inline short ArrayShort.updateindex( ArrayShort array, int index, Symbol op, short rhs)
Applies integer op to raw element index and returns the stored value.
The index has the unchecked C-pointer preconditions of bracket access.
Arithmetic follows the generated C operators, integer promotions, and
result conversion. A failing operation leaves the element unchanged.
Raises: <div-zero>, <bad-shift>, or <bad-op> for its corresponding
invalid operation.
Source: lib/typed-array.x:119
ArrayShort.var
inline Var ArrayShort.var(ArrayShort array)
Boxes array with its registered packed-array tag without copying.
The boxed and typed values share the same mutable object identity.
Source: lib/typed-array.x:120
ArrayShort.write_repr
Buffer ArrayShort.write_repr(ArrayShort array, Buffer out)
Appends the readable packed-Array representation to out.
Source: lib/typed-array.x:116
ArrayShort.write_str
Buffer ArrayShort.write_str(ArrayShort array, Buffer out)
Appends the packed-Array display text to out.
Source: lib/typed-array.x:116
ArrayString
ArrayString.array
Array ArrayString.array(ArrayString array)
Returns a fresh ordinary Array containing boxed elements in source order. A null input returns NULL. The typed Array and its storage are unchanged.
Raises: any cause from boxing or appending an element.
Source: lib/typed-array.x:161
ArrayString.block
inline Block ArrayString.block(ArrayString array)
Views array as the same underlying Block storage.
Source: lib/typed-array.x:165
ArrayString.compare
int ArrayString.compare(ArrayString a, ArrayString b)
Compares packed Arrays lexicographically with the element family’s ordering. Identical handles compare equal and NULL sorts first.
Source: lib/typed-array.x:161
ArrayString.concat
Self ArrayString.concat(Self a, Self b)
Returns a fresh array holding a followed by b.
Neither input is modified. A null a returns NULL, while a null b
produces an independent copy of a.
Raises: <size-limit> or <alloc-fail> when the result cannot be
represented or allocated.
Source: lib/typed-array.x:160
ArrayString.contains
int ArrayString.contains(ArrayString array, String value)
Reports whether a native element equals value.
The scan is linear. Raises: <size-limit> when the length exceeds the
integer index domain.
Source: lib/typed-array.x:160
ArrayString.copy
Self ArrayString.copy(Self array)
Returns a fresh packed copy, or NULL for a null array. The result has independent mutable storage containing the same stored values.
Raises: <size-limit> or <alloc-fail> when the copy cannot be
represented or allocated.
Source: lib/typed-array.x:160
ArrayString.count
int ArrayString.count(ArrayString array, String value)
Returns how many native elements equal value.
A null array returns zero; the scan is linear.
Raises: <size-limit> when the length exceeds the integer index domain.
Source: lib/typed-array.x:160
ArrayString.equal
int ArrayString.equal(ArrayString a, ArrayString b)
Reports elementwise native equality. Two null arrays compare equal; one null array or different lengths compare unequal.
Source: lib/typed-array.x:160
ArrayString.find
int ArrayString.find(ArrayString array, String value)
Returns the first index whose native element equals value, or -1.
A null array returns -1; the scan is linear and preserves source order.
Raises: <size-limit> when the length exceeds the integer index domain.
Source: lib/typed-array.x:160
ArrayString.getindex
inline String ArrayString.getindex(ArrayString array, int index)
Returns the element at raw index with no bounds or null check.
Negative indices are not normalized, and an invalid index has the same
undefined behavior as indexing the equivalent C pointer.
Source: lib/typed-array.x:160
ArrayString.getslice
Self ArrayString.getslice(Self array, int start, int end, int step)
Returns a fresh packed array for normalized [start:end:step].
Negative bounds count from the end and a negative step walks backward.
Raises: <bad-arg> for a null array or zero step, <size-limit> outside
the integer index domain, or <alloc-fail> on allocation failure.
Source: lib/typed-array.x:160
ArrayString.indexof
int ArrayString.indexof(ArrayString array, String value)
Returns the same first-match index as ArrayString.find.
Source: lib/typed-array.x:160
ArrayString.insert
String ArrayString.insert(ArrayString array, int index, String value)
Inserts value at normalized index and returns it.
The accepted range includes the position after the last element;
negative indices are normalized against that wider range.
Raises: <bad-arg> for a null array or out-of-range index,
<size-limit> at the integer index limit, or <alloc-fail> when storage
cannot grow.
Source: lib/typed-array.x:160
ArrayString.iter
Iter ArrayString.iter(ArrayString array, Iter dest)
Initializes dest to lazily yield boxed elements in index order.
Returns dest, whose storage is caller-owned. The iterator borrows
array and reads its current storage on each step, so both must remain
live and mutation can change the remaining traversal. A null dest
returns NULL. A null array, or one longer than the integer index domain,
is exhausted. A boxed wide element is Scope-owned;
retaining one after a
pull requires its owning Scope to remain live.
Raises: any cause from boxing an element.
Source: lib/typed-array.x:165
ArrayString.new
ArrayString ArrayString.new(void)
Returns a fresh empty packed array owned by the current Scope.
Raises: <alloc-fail> when storage cannot be allocated.
Source: lib/typed-array.x:160
ArrayString.postfixindex
inline String ArrayString.postfixindex( ArrayString array, int index, Symbol op)
Raises <bad-op> because String elements have no postfix operation.
Source: lib/typed-array.x:164
ArrayString.push
String ArrayString.push(ArrayString array, String value)
Appends value and returns it.
Raises: <bad-arg> for a null array, <size-limit> at the integer index
limit, or <alloc-fail> when storage cannot grow.
Source: lib/typed-array.x:160
ArrayString.remove
String ArrayString.remove(ArrayString array, int index)
Removes and returns the element at normalized index.
Negative indices count from the end; following elements shift left.
Raises: <bad-arg> for a null array or out-of-range index, or
<size-limit> when the length exceeds the integer index domain.
Source: lib/typed-array.x:160
ArrayString.remslice
Self ArrayString.remslice(Self array, int start, int end)
Removes normalized bounds [start:end] and returns a fresh packed array.
Reversed bounds are swapped, and the removed values retain their order.
Raises: <bad-arg> for a null array, <size-limit> outside the integer
index domain, or <alloc-fail> on allocation failure.
Source: lib/typed-array.x:160
ArrayString.repr
String ArrayString.repr(ArrayString array)
Returns the readable packed-Array representation.
Source: lib/typed-array.x:161
ArrayString.reverse
Self ArrayString.reverse(Self array)
Reverses array in place and returns that same array.
A null or one-element array is returned unchanged.
Source: lib/typed-array.x:160
ArrayString.setindex
inline String ArrayString.setindex(ArrayString array, int index, String value)
Stores and returns value at raw index with no bounds or null check.
Negative indices are not normalized, and an invalid index has the same
undefined behavior as indexing the equivalent C pointer.
Source: lib/typed-array.x:160
ArrayString.setslice
Self ArrayString.setslice(Self array, int start, int end, Self values)
Replaces normalized bounds [start:end] and returns array.
Reversed bounds are swapped; null values deletes the region. Passing
array itself as values is supported and copies before mutation.
Raises: <bad-arg> for a null array, <size-limit> outside the integer
index domain, or <alloc-fail> while copying self-aliased values or
growing storage for the replacement. These failures leave array
unchanged.
Source: lib/typed-array.x:160
ArrayString.shift
String ArrayString.shift(ArrayString array)
Removes and returns the first element, shifting the remainder left. This operation is O(n).
Raises: <bad-arg> for a null or empty array, or <size-limit> when the
length exceeds the integer index domain. These failures do not return.
Source: lib/typed-array.x:160
ArrayString.splice
Self ArrayString.splice(Self array, int index, int remove_count, Self values)
Replaces remove_count values at normalized index and returns them.
The result is a fresh packed array. A nonpositive count removes nothing;
null values performs deletion, and self-splicing is supported.
Raises: <bad-arg> for a null array, <size-limit> outside the integer
index domain, or <alloc-fail> on allocation failure.
Source: lib/typed-array.x:160
ArrayString.str
String ArrayString.str(ArrayString array)
Returns the packed-Array display String.
Source: lib/typed-array.x:161
ArrayString.take_last
String ArrayString.take_last(ArrayString array)
Removes and returns the last element.
Raises: <bad-arg> for a null or empty array.
Source: lib/typed-array.x:160
ArrayString.try_get
int ArrayString.try_get(ArrayString array, int index, String *out)
Reads normalized index into out and reports whether it exists.
Negative indices count from the end. A null array, null out, or
out-of-range index returns zero without writing; success returns one.
Raises: <size-limit> when the length exceeds the integer index domain.
Source: lib/typed-array.x:160
ArrayString.try_next
int ArrayString.try_next(ArrayString array, int *cursor, String *out)
Writes the next native element, advances cursor, and returns one.
Initialize the caller-owned cursor to zero. A null argument, negative
cursor, exhaustion, or an array outside the integer index domain returns
zero without changing cursor or out. Structural mutation invalidates
the cursor.
Source: lib/typed-array.x:160
ArrayString.try_take_last
int ArrayString.try_take_last(ArrayString array, String *out)
Removes the last element into out and returns one when present.
A null or empty array, or null out, returns zero without writing or
changing the array.
Source: lib/typed-array.x:160
ArrayString.unshift
String ArrayString.unshift(ArrayString array, String value)
Inserts value at the front and returns it, shifting elements right.
This operation is O(n).
Raises: <bad-arg> for a null array, <size-limit> at the integer index
limit, or <alloc-fail> when storage cannot grow.
Source: lib/typed-array.x:160
ArrayString.updateindex
inline String ArrayString.updateindex( ArrayString array, int index, Symbol op, String rhs)
Concatenates rhs onto the String at raw index and returns the stored
canonical String. The index has the unchecked C-pointer preconditions of
bracket access. Raises: <bad-op> for any operation other than +.
A failure leaves the element unchanged.
Source: lib/typed-array.x:164
ArrayString.var
inline Var ArrayString.var(ArrayString array)
Boxes array with its registered packed-array tag without copying.
The boxed and typed values share the same mutable object identity.
Source: lib/typed-array.x:165
ArrayString.write_repr
Buffer ArrayString.write_repr(ArrayString array, Buffer out)
Appends the readable packed-Array representation to out.
Source: lib/typed-array.x:161
ArrayString.write_str
Buffer ArrayString.write_str(ArrayString array, Buffer out)
Appends the packed-Array display text to out.
Source: lib/typed-array.x:161
Var
Var.arraychar
inline ArrayChar Var.arraychar(Var value)
Returns the packed-array pointer carried by value.
value must carry this array family’s registered tag; the converter
does not validate the tag before reading its pointer payload.
Source: lib/typed-array.x:111
Var.arraydbl
inline ArrayDbl Var.arraydbl(Var value)
Returns the packed-array pointer carried by value.
value must carry this array family’s registered tag; the converter
does not validate the tag before reading its pointer payload.
Source: lib/typed-array.x:156
Var.arrayfloat
inline ArrayFloat Var.arrayfloat(Var value)
Returns the packed-array pointer carried by value.
value must carry this array family’s registered tag; the converter
does not validate the tag before reading its pointer payload.
Source: lib/typed-array.x:147
Var.arrayint
inline ArrayInt Var.arrayint(Var value)
Returns the packed-array pointer carried by value.
value must carry this array family’s registered tag; the converter
does not validate the tag before reading its pointer payload.
Source: lib/typed-array.x:129
Var.arraylong
inline ArrayLong Var.arraylong(Var value)
Returns the packed-array pointer carried by value.
value must carry this array family’s registered tag; the converter
does not validate the tag before reading its pointer payload.
Source: lib/typed-array.x:138
Var.arrayshort
inline ArrayShort Var.arrayshort(Var value)
Returns the packed-array pointer carried by value.
value must carry this array family’s registered tag; the converter
does not validate the tag before reading its pointer payload.
Source: lib/typed-array.x:120
Var.arraystring
inline ArrayString Var.arraystring(Var value)
Returns the packed-array pointer carried by value.
value must carry this array family’s registered tag; the converter
does not validate the tag before reading its pointer payload.
Source: lib/typed-array.x:165
Public types
| Type | Kind | Summary |
|---|---|---|
ArrayChar | alias | A mutable, Scope-owned packed Array of native char elements. |
ArrayDbl | alias | A mutable, Scope-owned packed Array of native double elements. |
ArrayFloat | alias | A mutable, Scope-owned packed Array of native float elements. |
ArrayInt | alias | A mutable, Scope-owned packed Array of native int elements. |
ArrayLong | alias | A mutable, Scope-owned packed Array of native long elements. |
ArrayShort | alias | A mutable, Scope-owned packed Array of native short elements. |
ArrayString | alias | A 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).