[m-dev.] User-controlled pretty-printing
Julien Fischer
juliensf at csse.unimelb.edu.au
Wed Jan 10 13:42:06 AEDT 2007
On Wed, 10 Jan 2007, Ian MacLarty wrote:
> On Thu, Dec 14, 2006 at 09:44:15AM +1100, Ralph Becket wrote:
>> Recap: I suggested that we could add support for user-defined term
>> pretty-printing to mdb by allowing programs to provide their own
>> pretty printers for various types (e.g., for lists, maps, arrays,
>> etc.) Each pretty printer would take a univ and some control parameters
>> (e.g., to control how much of the term is to be printed) and either
>> succeed, returning a pprint.doc, or fail, if the value contained in the
>> univ has the wrong type or form. Zoltan pointed out that we want rich
>> control over what is printed and also need a sensible mechanism for
>> navigating through abstract types (e.g., we don't want to have to
>> specify a path through a 234-tree when looking for a particular entry in
>> a map).
>>
>> So, what we want is:
>>
>> - the ability to navigate to a subterm using an abstract address
>> e.g., go to the "3rd list item" rather than navigating through cons
>> cells with "2/2/2/1";
>>
>
> Just to point out that you can use the cdr browser command to quickly
> navigate into deep recursive structures.
Yes, but that's at a lower level of abstraction to what Ralph wants,
i.e. the ability to say go to the nth element of a list, get the value
corresponding to this key from a map.
Julien.
--------------------------------------------------------------------------
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