[m-rev.] for review: compare/unify tuples and handle var arity type-infos in rtti_implementatation

Ralph Becket rafe at cs.mu.OZ.AU
Fri Nov 29 08:14:52 AEDT 2002


Peter Ross, Thursday, 28 November 2002:
> 
> Index: library/rtti_implementation.m
> ===================================================================
> RCS file: /home/mercury1/repository/mercury/library/rtti_implementation.m,v
> retrieving revision 1.25
> diff -u -r1.25 rtti_implementation.m
> --- library/rtti_implementation.m	28 Nov 2002 07:26:08 -0000	1.25
> +++ library/rtti_implementation.m	28 Nov 2002 18:49:59 -0000
> @@ -512,7 +592,12 @@
>  	( 
>  		type_ctor_is_variable_arity(TypeCtorInfo)
>  	->
> -		error("rtti_implementation.m: unimplemented: tuples and higher order type comparisons")
> +		Arity = get_var_arity_typeinfo_arity(TypeInfo),
> +		TypeArgs = iterate(1, Arity,
> +			(func(X) = Y :-
> +				Y = TypeInfo ^ var_arity_type_info_index(X)
> +			)
> +		)

Why not just (func(X) = TypeInfo ^ var_arity_type_info_index(X)) ?

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