[m-rev.] for review: --trace-table-descendant-io and --trace-table-io-unitize

Mark Brown dougl at cs.mu.OZ.AU
Fri Jul 26 03:37:21 AEST 2002


On 23-Jul-2002, Zoltan Somogyi <zs at cs.mu.OZ.AU> wrote:
> Add two new annotations for foreign_procs, tabled_for_descendant_io and
> tabled_for_io_unitize.

> trace/mercury_trace_base.c:

s/trace_base/trace/

> Index: compiler/prog_io_pragma.m
> ===================================================================
> RCS file: /home/mercury1/repository/mercury/compiler/prog_io_pragma.m,v
> retrieving revision 1.51
> diff -u -b -r1.51 prog_io_pragma.m
> --- compiler/prog_io_pragma.m	2002/06/30 17:06:38	1.51
> +++ compiler/prog_io_pragma.m	2002/07/21 15:04:59
> @@ -1144,7 +1144,17 @@
>  		thread_safe(thread_safe) - 
>  			thread_safe(not_thread_safe),
>  		tabled_for_io(tabled_for_io) - 
> +			tabled_for_io(tabled_for_io_unitize),
> +		tabled_for_io(tabled_for_io) - 
> +			tabled_for_io(tabled_for_descendant_io),
> +		tabled_for_io(tabled_for_io) - 
>  			tabled_for_io(not_tabled_for_io),
> +		tabled_for_io(tabled_for_io_unitize) - 
> +			tabled_for_io(tabled_for_descendant_io),
> +		tabled_for_io(tabled_for_io_unitize) - 
> +			tabled_for_io(not_tabled_for_io),
> +		tabled_for_io(tabled_for_descendant_io) - 
> +			tabled_for_io(not_tabled_for_io),
>  		purity(pure) - purity(impure),
>  		purity(pure) - purity(semipure),
>  		purity(semipure) - purity(impure)

Now that this relation is getting a bit more complex, it is probably
worth making it into a Mercury predicate of its own.

> Index: tests/debugger/tabled_read_unitize.m
> ===================================================================
> RCS file: tabled_read_unitize.m
> diff -N tabled_read_unitize.m
> --- /dev/null	Fri Dec  1 02:25:58 2000
> +++ tabled_read_unitize.m	Mon Jul 22 02:07:45 2002
> @@ -0,0 +1,120 @@
> +% We define our own I/O primitives, in case the library was compiled without
> +% IO tabling.
> +
> +:- module tabled_read_unitize.
> +
> +:- interface.
> +
> +:- import_module io.
> +
> +:- pred main(io__state, io__state).
> +:- mode main(di, uo) is det.
> +
> +:- implementation.
> +
> +:- import_module list, char, int.
> +
> +main -->
> +	tabled_read_unitize__open_input("tabled_read_unitize.data", Res,
> +		Stream),
> +	( { Res = 0 } ->
> +		tabled_read_unitize__read_num(Stream, A),
> +		tabled_read_unitize__unitize(Stream, B),
> +		tabled_read_unitize__read_num(Stream, C),
> +		tabled_read_unitize__write_int(A),
> +		tabled_read_unitize__write_int(B),
> +		tabled_read_unitize__write_int(C)
> +	;
> +		io__write_string("could not open tabled_rea_unitized.data\n")

There's a couple of typos in that error message.

Other than that, this change is fine.

Cheers,
Mark.

--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list