New Issue: I/O module: replace stringify function with string.write

20256, "mppf", "I/O module: replace stringify function with string.write", "2022-07-19T19:37:13Z"

This issue is about this existing IO module function:

proc stringify(const args ...?k): string
  • It should throw since writeThis / encodeThis etc can throw
  • stringify doesn’t seem a very good name
  • Related ideas are "%i".format(1) in Chapel and repr in Python

We can consider using either or both of the following alternatives to replace stringify:

string.write type method

proc type string.write(const args ...?k): string throws

// used like this:
var x = string.write(1, 2, 3);
// now x stores "123"

string.write method

proc string.write(const args ...?k): void throws
// used like this
var x = "hello";
x.write(1, 2, 3);
// Open Question:  does this replace the string or append to it?
// In other words, is x now "hello123" or just "123"?