[m-dev.] explicit stream arguments in library predicates
Julien Fischer
jfischer at opturion.com
Fri Oct 28 23:44:27 AEDT 2016
Hi Zoltan.
On Fri, 28 Oct 2016, Zoltan Somogyi wrote:
> 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.
> 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.
More information about the developers
mailing list