Implemented implicit array argument broadcasting
Bradley Lucier 05 Jan 2026 01:50 UTC
TL;DR: After implementing array argument broadcasting, I'm not aware of
any deficiencies in the updated SRFI 231 that I think need to be
remedied. I still need to document the changes, but otherwise I like
the library design.
With this commit:
https://github.com/gambiteer/srfi-231/commit/36c7522136a06f6b58b664366084b0cc49f18186
I implemented implicit array argument broadcasting for the procedures
array-{map|for-each|every|any|fold-left|fold-right}. Following Python's
NumPy, but not Racket's math/array, array arguments to array-stack and
array-append are not implicitly broadcast.
Whether array arguments are implicitly broadcast is determined by the
parameter array-broadcasting?.
We do not do what Racket's math/array calls "permissive" array
broadcasting, largely because the array transform requires a non-affine
map that doesn't compose well with other transforms.
There is not yet any documentation about the changes, but there are
minimal tests.
Brad