[m-rev.] for review: implement arg_cc in Mercury

Fergus Henderson fjh at cs.mu.OZ.AU
Mon Dec 2 20:05:06 AEDT 2002


On 30-Nov-2002, Peter Ross <pro at missioncriticalit.com> wrote:
> Branches: main
> 
> Implement arg_cc in Mercury using rtti_implementation.
> 
> library/deconstruct.m:
> 	Implement univ_arg_idcc as a cc_multi predicate with the
> 	success of the predicate encoded into a maybe type, as it is
> 	impossible to implement is as cc_nondet.
> 	Change the C code version of univ_arg_idcc to match the
> 	Mercury versions behaviour.
> 	Delete the bogus modes of arg/4 and implement them as arg_cc/3
> 	instead.
> 
> library/std_util.m:
> 	Introduce a new type maybe_arg which is returned by arg_cc to
> 	return its result.
> 	Change arg_cc to have the correct determinism and type
> 	signature.
> 	Add utility predicates which allow us to construct values of
> 	the maybe type from a foreign language.

The interface changes should be mentioned in the NEWS file.

> Index: library/std_util.m
> +:- type maybe_arg
> +	--->	some[T] arg(T)
> +	;	no.

s/some[T]/some [T]/

Also, the return value from arg_cc should be documented more clearly.

> Index: runtime/mercury_ml_arg_body.h
> ===================================================================
> RCS file: /home/mercury1/repository/mercury/runtime/mercury_ml_arg_body.h,v
> retrieving revision 1.3
> diff -u -r1.3 mercury_ml_arg_body.h
> --- runtime/mercury_ml_arg_body.h	18 Feb 2002 07:01:18 -0000	1.3
> +++ runtime/mercury_ml_arg_body.h	30 Nov 2002 15:15:00 -0000
> @@ -70,6 +70,8 @@
>          MR_new_univ_on_hp(SELECTED_ARG, arg_type_info, *argument_ptr);
>      }
>  
> +#ifndef MR_NONCANON_CC
>      SUCCESS_INDICATOR = success;
> +#endif

That is wrong.  MR_NONCANON_CC is an enumeration constant, not a macro.

Apart from that, this looks fine.  I'd like to see another diff, though.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
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