Returns a FoscTypedArray.
A typed array.
| ++ | Concatenates typed list and expr. |
| append | Appends item to typed array. |
| addAll | |
| insert | Insert item at index. |
| prepend | Prepends item to typed array. |
| put | Put item at index. |
| remove | Remove item. |
| removeAt | Remove item at index. |
| sort | Sort the contents of the collection using optional comparison function. |
| at | Gets item at index. |
| atAll | Gets items at indices. |
| includes | Answer true if item exists in collection. |
| indexOf | (abjad: index) |
| occurrencesOf | (abjad: count) |
| inspect | Inspect items in collection. |
Example
x = FoscTypedArray([1, 2, 3, 4], Number);
x.cs;FoscTypedArray([
1,
2,
3,
4
])Concatenates typed list and expr.
Returns new typed list.
FIXME ERROR: Meta_FoscTypedArray:new: item a FoscTypedArray is the wrong type: FoscTypedArray.
a = FoscTypedArray([1, 2, 3, 4], Number);
b = FoscTypedArray([5, 6], Number);
(a ++ b).items;a = FoscTypedArray([1, 2, 3, 4], Number);
b = [5, 6]; // coerce to itemClass
(a ++ b).items;[ 5, 6 ]Appends item to typed array.
Returns new typed array.
Example
a = FoscTypedArray([1, 2, 3, 4], Number);
a = a.add(5);
a.items;[ 1, 2, 3, 4, 5 ]Example
a = FoscTypedArray([1, 2, 3, 4], Number);
a = a.addAll([5, 6, 7]);
a.items;prFormatCodeString interpret initial failed: a DoesNotUnderstandError
a = FoscTypedArray([1, 2, 3, 4], Number);
a = a.addAll([5, 6, 7]);
Insert item at index.
Returns new typed array.
Example
a = FoscTypedArray([1, 2, 3, 4], Number);
a = a.insert(2, 99);
a.items;[ 1, 2, 99, 3, 4 ]Prepends item to typed array.
Returns new typed array.
Example
a = FoscTypedArray([1, 2, 3, 4], Number);
a = a.prepend(5);
a.items;[ 5, 1, 2, 3, 4 ]Put item at index.
Returns new typed array.
Example
a = FoscTypedArray([1, 2, 3, 4], Number);
a = a.put(2, 99);
a.items;[ 1, 2, 99, 4 ]Remove item.
Returns removed item.
Example
a = FoscTypedArray([1, 2, 3, 4], Number);
a.remove(2);
a.items;[ 1, 3, 4 ]Remove item at index.
Returns removed item.
Example
a = FoscTypedArray([1, 2, 3, 4], Number);
a.removeAt(1);
a.items;[ 1, 3, 4 ]Sort the contents of the collection using optional comparison function.
Returns new typed array.
Example
a = FoscTypedArray([5, 2, 3, 4], Number);
a = a.sort;
a.items;[ 2, 3, 4, 5 ]
a = FoscTypedArray([5, 2, 3, 4], Number);
a = a.sort { |a, b| a > b };
a.items;[ 5, 4, 3, 2 ]Gets item at index.
Returns item.
Example
a = FoscTypedArray([1, 2, 3, 4], Number);
a[2];3Gets items at indices.
Returns items.
Example
a = FoscTypedArray([1, 2, 3, 4], Number);
a[(2..3)];[ 3, 4 ]Answer true if item exists in collection.
Returns boolean.
Example
a = FoscTypedArray([1, 2, 3, 4], Number);
a.includes(3);
a.includes(5);false(abjad: index)
Return the first index matching item.
Returns nonnegative integer.
Example
a = FoscTypedArray([1, 2, 3, 4], Number);
a.indexOf(3);2(abjad: count)
Return the number of occurrences of item in collection.
Returns nonnegative integer.
Example
a = FoscTypedArray([1, 2, 3, 4], Number);
a.occurrencesOf(3);1Inspect items in collection.
Example
a = FoscTypedArray([1, 2, 3, 4], Number);
a.inspect;FoscTypedArray([
1,
2,
3,
4
])