Current plans for "reshaping" arrays Bradley Lucier 17 May 2020 19:30 UTC

I've just pushed to

changes that allow (array-assign! destination source) to succeed even if
destination and source do not have the same domains if: (a) they have
the same number of elements, (b) destination is a specialized array, and
(c) the elements of destination are stored adjacently and in order in
its body.

array-copy already allows different domains with the same number of

Both these procedures allow one to take the elements of one array and
insert them, in the same order, into the body of another array with a
different shape.

This is more limited than what Python/NumPy offers, but it's not clear
to me what NumPy does in any case. (After googling, it seems that only
by reading and understanding the C source for the reshape code does
anyone understand under what circumstances NumPy will "reshape" an array.)

I'll ask Arthur to publish another draft after I wait a bit for any