[m-dev.] thoughts: script language for term browser

Fergus Henderson fjh at cs.mu.OZ.AU
Tue Sep 1 07:15:15 AEST 1998


On 28-Aug-1998, Bert THOMPSON <aet at cs.mu.OZ.AU> wrote:
> 
> In order to display terms in as flexible a manner as possible,
> we need a scripting language.

This is not the only possible way of providing that kind of
functionality.  We could for example use the same technique as gdb:
just allow calls to arbitrary Mercury predicates from within the
debugger (e.g. `call my_print(X)').

I think in general if people are going to write fancy pretty-print
routines to print Mercury data terms, it will be easier if they can
do this in Mercury.  And if they do write such pretty-printers in
Mercury, that will make it easier for them to reuse the pretty-printers
in their Mercury programs.

A simple debugger command to associate a print routine with a given
type name would be sufficient.

Note that there are some values for which type_to_term cannot
produce a value of type `term', for example values containing `c_pointer's.
The only way to print out such values may be by calling some
Mercury predicates implemented via `pragma c_code'.

-- 
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.



More information about the developers mailing list