This is very preliminary, and was compiled by scouring features from ISO/IEC 13751, Extended APL.

(array-depth a) => examines all elements and recursively calls itself on any elements that are arrays.  Returns one more than its deepest array element.

array-recursive-get and array-recursive-set: the same as calling the array's getter and setter, but additional arguments are used to index an element that is itself an array recursively until the arguments run out.  It is an error if there aren't enough arguments to index the array or a particular nested array.

(recursive-array->list a) => similar to array->list, but any elements that are arrays are recursively converted to lists.  This result can then be flattened to find all elements in all enclosed arrays.

(iterated-list->specialized-array list . <make-specialized-array args>) => similar to list->specialized-array but if the list is exhausted, repeats its elements until the result array is full.

(array-fold-on proc knil a dim) => like array-fold, but instead of processing all elements in lexicographic order, divides a into sub-arrays on dimension dim and folds over the the sub-arrays instead.

(array-inner-product sum product a1 a2) => constructs the inner product (dot product, matrix product) of a1 and a2, using the dyadic function *product* to multiply individual elements and the variadic function *sum* to total them.  It is an error if the bounds of the last dimension of a1 are not equal to the bounds of the first dimension of a2; the bounds of the result are all the remaining bounds of a1 followed by all the remaining bounds of a2.

(array-catenate a1 a2 dim) => glues together a1 and a2, which must have the same interval, along dimension dim.  We also need array-laminate, but I have not worked that out yet.

(array-find = a vec) => searches through the elements of a in lexicographic order looking for the first element that is equal (in the sense of the = argument) to an element of vec.  The result is a vector the same size as vec containing the indices of these occurrences, or #f if there is no occurrence.

(array-grade < a dim) => slices a into subarrays along dimension dim and returns a vector which specifies the permutation of the slices along dimension dim that puts them in increasing order in the sense of the < argument.

(Of course any of these could be incorporated into SRFI 122bis.)

A few more ideas not yet worked out: array-broadcast, array-expand, array-replicate.

Comments?



John Cowan          http://vrici.lojban.org/~cowan        xxxxxx@ccil.org
This great college [Trinity], of this ancient university [Cambridge],
has seen some strange sights. It has seen Wordsworth drunk and Porson
sober. And here am I, a better poet than Porson, and a better scholar
than Wordsworth, somewhere betwixt and between.  --A.E. Housman