I recommend that the format string be replaced by a procedure that accepts two arguments, the object to be printed and a port to print it to, with the default procedure being `display`.  This will make `format-array` equally useful to template systems like SRFI 48 and combinator systems like SRFI 159.

If passing the array is also desirable, it could be bound to an exposed SRFI 39 / R7RS parameter object.

On Sat, Nov 17, 2018 at 8: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). 

To unsubscribe from this list please go to http://www.simplelists.com/confirm.php?u=tWlGCqC6pqLcfVPDiDSiS03ly9uOl10I