[m-dev.] Contribution: Pretty Printing Library

Fergus Henderson fjh at cs.mu.OZ.AU
Wed Apr 12 14:49:55 AEST 2000


A good exercise to see whether the interface to this pretty printing
library is general enough to be widely useful would be to try
reimplementing compiler/error_util.m using it.

I think the answer will be that it is not quite general enough,
because it only provides indentation by N spaces (`nest(int, doc)'),
rather than allowing the programmer to specify that something
should be indented by inserting some given string in the left
hand column.

I think there are a lot of cases where it would be useful to
allow indentation by an arbitrary string.  For example,
suppose you are generating program code, and consider
formatting text which will appear in comments.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3        |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list