[m-rev.] for review: test cases for clause mode annotations

Simon Taylor stayl at cs.mu.OZ.AU
Thu May 17 01:55:44 AEST 2001


On Thu, May 17, 2001 at 01:17:42AM +1000, Fergus Henderson wrote:
> This addresses Simon Taylor's review comment on my earlier change,
> namely the lack of test cases.
> 
> Estimated hours taken: 2
> Branches: main
> 
> tests/hard_coded/Mmakefile:
> tests/hard_coded/multimode.m:
> tests/hard_coded/multimode.exp:
> tests/invalid/Mmakefile:
> tests/invalid/multimode_missing_impure.m:
> tests/invalid/multimode_missing_impure.err_exp:
> tests/invalid/multimode_dcg.m:
> tests/invalid/multimode_dcg.err_exp:
> tests/invalid/multimode_syntax.m:
> tests/invalid/multimode_syntax.err_exp:
> 	Add some test cases for my recent change to add support
> 	using different clauses for different modes.

Thanks Fergus.

> Index: tests/hard_coded/multimode.m
> ===================================================================
> +main -->
> +	{ In = 42 },
> +
> +	% test pure functions
> +	print(func0), nl,
> +	print(func1(In)), nl,
> +	print(func1(_Out0)), nl,
> +	%print(func2(In, In)), nl,
> +	print(func2(In, _Out1)), nl,
> +	print(func2(_Out2, In)), nl,
> +	print(func2(_Out3, _Out4)), nl,

> +:- pragma promise_pure(func2/2). % XXX technically this is a lie
> +:- func func2(int, int) = string.
> +%:- mode func2(in, in) = out is det.
> +:- mode func2(in, out) = out is det.
> +:- mode func2(out, in) = out is det.
> +:- mode func2(out, out) = out is det.
> +%func2(_::in, _::in) = (R::out) :-
> +%	R = "func2(in, in) = out".

Why is that mode commented out?

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