Discussion:
[m-dev.] explicit stream arguments in library predicates
Zoltan Somogyi
2016-10-28 09:47:43 UTC
Permalink
I am working on making the library and compiler use explicit I/O streams
where possible. In some cases, this requires adding new versions of existing
predicates (such as term_io.write_constant/3) that implicitly write to
the current output stream, with the new versions taking an extra
io.text_output_stream argument.

However, in a few cases, such as term_io.quote_string and pprint.write,
the new name/arity pair is already in use, with the higher arity version
having not an extra io.text_output_stream argument, but an extra
stream_writer stream argument.

Would people mind if I resolved these name collisions by renaming
the existing stream_writer versions of these predicates, adding
a suffix such as "_to_stream"? This would break backward compatibility,
but in a trivially-fixable way.

Zoltan.
Julien Fischer
2016-10-28 12:44:27 UTC
Permalink
Hi Zoltan.
Post by Zoltan Somogyi
I am working on making the library and compiler use explicit I/O streams
where possible. In some cases, this requires adding new versions of existing
predicates (such as term_io.write_constant/3) that implicitly write to
the current output stream, with the new versions taking an extra
io.text_output_stream argument.
However, in a few cases, such as term_io.quote_string and pprint.write,
the new name/arity pair is already in use, with the higher arity version
having not an extra io.text_output_stream argument, but an extra
stream_writer stream argument.
The latter subsume the former since io.text_output_stream's are
instances of all the required typeclasses.
Post by Zoltan Somogyi
Would people mind if I resolved these name collisions by renaming
the existing stream_writer versions of these predicates, adding
a suffix such as "_to_stream"? This would break backward compatibility,
but in a trivially-fixable way.
Are the specific reasons (e.g. performance) you just don't want to use
the generic stream versions?

Julien.

Loading...