[m-rev.] for review: implement unify and compare for .NET in Mercury
Peter Ross
peter.ross at miscrit.be
Wed Aug 22 20:16:34 AEST 2001
On Mon, Aug 20, 2001 at 03:37:50PM +0200, Tyson Dowd wrote:
> Hi,
>
>
> ===================================================================
>
>
> Estimated hours taken: 10
> Branches: main
>
> Implement generic unify and compare in (mostly) Mercury instead of MC++.
>
> library/builtin.m:
> Call into rtti_implementation to implement unify and compare for
> the .NET backend.
>
> library/rtti_implementation.m:
> Implement unify and compare in Mercury.
>
>
Looks fine except for one little thing.
> +
> +:- func index(int, type_info) = type_info.
> +:- pragma foreign_proc("C#",
> + index(X::in, TypeInfo::in) = (TypeInfoAtIndex::out), [], "
> + TypeInfoAtIndex = (object[]) TypeInfo[X];
> +").
> +
> +index(_::in, TypeInfo::in) = (TypeInfo::out) :-
> + det_unimplemented("index").
> +
I suggest you place a comment similar to the one above that the mercury
code is the catch all case, when a foreign code implementation doesn't
exist.
> +
> +:- pred semidet_unimplemented(string::in) is semidet.
> +semidet_unimplemented(S) :-
> + ( std_util__semidet_succeed ->
> + error("unimplemented: " ++ S)
> + ;
> + std_util__semidet_succeed
> + ).
> +
> +:- pred det_unimplemented(string::in) is det.
> +det_unimplemented(S) :-
> + ( std_util__semidet_succeed ->
> + error("unimplemented: " ++ S)
> + ;
> + true
> + ).
> +
I suggest you add the module name in these predicates.
Pete
--------------------------------------------------------------------------
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