[m-dev.] User-controlled pretty-printing

Ian MacLarty maclarty at csse.unimelb.edu.au
Wed Nov 1 15:35:58 AEDT 2006


On Wed, Nov 01, 2006 at 02:44:11PM +1100, Ralph Becket wrote:
> An oft cited request for the debugger is the ability to control how
> different types are pretty-printed.  To date we have assumed that this
> requires dynamic type class casts so we could ask of any value X whether
> it is a member of the pretty_printable type class and if so use the
> pretty_printable method, otherwise use the default method.  For
> technical reasons, dynamic type class casts are still some way off.
> 
> I have an alternative proposal that should work for the debugger and
> program output in general.  The idea is that we have a global mutable
> attached to the IO state consisting of a list of predicates with the
> signature
> 
> 	pred(univ::in, pprint.doc::out) is semidet
> 

This seems like a good idea to me, though perhaps the signature of the
predicate should be:

	pred(univ::in, maybe(pprint.doc)::out) is cc_multi

to allow, for example, for printing out of pointer values of foreign type
values?

Ian.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at csse.unimelb.edu.au
Administrative Queries: owner-mercury-developers at csse.unimelb.edu.au
Subscriptions:          mercury-developers-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the developers mailing list