Email list hosting service & mailing list manager


Which argument list for array-append, array-stack? Bradley Lucier 03 Mar 2022 20:41 UTC

Currently the argument list for the new procedures array-stack and
array-append are

array-append [ storage-class [ mutable? [ safe? ] ] ] k array . arrays

and

array-stack [ storage-class [ mutable? [ safe? ] ] ] k array . arrays

This can be parsed, but it is a pain.  There are also implementation
limits on the number of arguments.  And many procedures keep

[ storage-class [ mutable? [ safe? ] ] ]

as the last three optional arguments.

I was thinking of changing this to

array-append k list-of-arrays [ storage-class [ mutable? [ safe? ] ] ]

array-stack k list-of-arrays [ storage-class [ mutable? [ safe? ] ] ]

which is easier to parse, but which also lines up well with

(define (list->array    interval  list    [...]))
(define (list*->array   dimension list*   [...]))
(define (vector->array  interval  vector  [...]))
(define (vector*->array dimension vector* [...]))

The caller would have to gather the arrays into a list, though.

I'm also working on

array-block array-of-arrays [ storage-class [ mutable? [ safe? ] ] ]

which is similar to numpy.block, and is a bit more general than an
inverse to array-tile.

Thoughts?

Brad