Array functions
Array functions
This section explains how to use array functions in APL.
The table summarizes the array functions available in APL.
Function | Description |
---|---|
array_concat | Concatenates a number of dynamic arrays to a single array. |
array_iff | Returns a new array containing elements from the input array that satisfy the condition. |
array_index_of | Searches the array for the specified item, and returns its position. |
array_length | Calculates the number of elements in a dynamic array. |
array_reverse | Reverses the order of the elements in a dynamic array. |
array_rotate_left | Rotates values inside a dynamic array to the left. |
array_rotate_right | Rotates values inside a dynamic array to the right. |
array_select_dict | Selects a dictionary from an array of dictionaries. |
array_shift_left | Shifts the values inside a dynamic array to the left. |
array_shift_right | Shifts values inside an array to the right. |
array_slice | Extracts a slice of a dynamic array. |
array_split | Splits an array to multiple arrays according to the split indices and packs the generated array in a dynamic array. |
array_sum | Calculates the sum of elements in a dynamic array. |
isarray | Checks whether a value is an array. |
pack_array | Packs all input values into a dynamic array. |
strcat_array | Takes an array and returns a single concatenated string with the array’s elements separated by the specified delimiter. |
Dynamic arrays
Most array functions accept a dynamic array as their parameter. Dynamic arrays allow you to add or remove elements. You can change a dynamic array with an array function.
A dynamic array expands as you add more elements. This means that you don’t need to determine the size in advance.
Was this page helpful?