It occurred to me that if we allow to pass a formatter procedure as element-format, it's better for it to receive the entire subarray as well, i.e. (array, object) -> string.
For example, while we're formatting #2a((#u8(1 2)) (#f32(1.0 2.0))), the formatter F will be called four times, with these arguments:

(F #u8(1 2) 1)
(F #u8(1 2) 2)
(F #f32(1.0 2.0) 1.0)
(F #f32(1.0 2.0) 2.0)

With the array argument, it can make more informed dispatch.



On Sat, Nov 17, 2018 at 3:17 PM Shiro Kawai <xxxxxx@gmail.com> wrote:
Since 'format' is not in the standard, the supported format string passed to element-format argument may vary among implementations.  It may cause writing portable code difficult.

I can think of two ideas (either or both):
- Be explicit on the supported format strings, e.g. "at least srfi-48 format strings should be recognized"
- Allow to pass a formatter procedure (obj -> string) to do the formatting.

The latter also allows finer control over heterogeneous array (e.g. #2a((#u8(1 2)) (#f32(1.0 2.0)) and you want to control integer array and flonum array separately).