[m-rev.] for review: move char_to_doc to pretty_printer.m
Julien Fischer
jfischer at opturion.com
Tue Dec 20 11:15:17 AEDT 2022
On Mon, 19 Dec 2022, Zoltan Somogyi wrote:
> For review of the idea of moving x_to_doc functions to pretty_printer.m.
> If approved, I would move all such functions to pretty_printer.m,
> leaving obsoleted forwarding functions behind. When we delete
> these later, one cause of circular .trans_opt dependencies
> will have its applicability domain significantly reduced.
> Specifically, it should get rid of the dependency of
> modules defining functions such as float_to_doc and uint_to_doc
> on pretty_printer.m, though the dependencies of modules
> defining operations that convert compound values such as
> arrays and bitmaps to docs on pretty_printer.m would remain
> in cases where the required types and access predicates
> are not exported to pretty_printer.m. This would be the case
> e.g. for tree234_to_doc, unless e.g. we export tree234_to_lazy_list
> (in a non-public interface) to pretty_printer.m.
So essentially what you are proposing is that to_doc predicates for builtin
types be defined in pretty_printer.m? That's fine by me.
I would note that the only reason that pretty_printer.m seesm to import
a lot of above modules is to initialise the default formatter map.
Another way of addressing the problem may be to initialise that map
in the stdlib initialisation code in library.m (which necessarily
imports all the relevant modules anyway).
Julien.
More information about the reviews
mailing list