For review: Term display helper

Fergus Henderson fjh at cs.mu.OZ.AU
Fri Feb 27 20:58:21 AEDT 1998


A couple more comments...

On 27-Feb-1998, Waye-Ian CHIEW <wchi at students.cs.mu.OZ.AU> wrote:
> # ============= Mmakefile ==============
> default_target:		frame_test frames_test term_interface_test \
> X			portray_test 
> X
> depend:			frame_test.depend frames_test.depend \
> X			term_interface_test.depend portray_test.depend 

It would be better to write that as follows:

 | PROGS = frame_test frames_test term_interface_test portray_test 
 | DEPENDS = $(PROGS:%=%.depend)
 | 
 | default_target: $(PROGS)
 | depend: $(DEPENDS)

> INTERFACE
> X
> X   The display helper will be a Mercury library.
> X
> X      portray(Term, Visible, Prefs, Output, State0, State).
> X      portray(term::in, visible::in, preference::in,
> X	      io__output_stream::in, io__state::di, io__state::uo) is det.

That should be

         portray(T::in, visible::in, preference::in,
	      io__output_stream::in, io__state::di, io__state::uo) is det.

         portray_univ(univ::in, visible::in, preference::in,
	      io__output_stream::in, io__state::di, io__state::uo) is det.

with portray defined as

	 portray(T, ...) -->
		portray_univ(univ(T), ...).

(Note that if/when we get existential types, portray_univ will be
unnecessary; you could implement portray_univ in terms of portray
using std_util:univ_value/1.)

> X      browse(term::in, visible::in, visible::out, 

Ditto.

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