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