[m-rev.] for review: promise scopes (part 1)
Julien Fischer
juliensf at cs.mu.OZ.AU
Wed Mar 23 17:49:23 AEDT 2005
On Mon, 21 Mar 2005, Zoltan Somogyi wrote:
> For review by Ralph. I would like feedback on the reference manual
> in particular.
>
...
> doc/reference_manual.texi:
> Document the new constructs.
>
> library/ops.m:
> Add the keywords of the new constructs to the list of operators.
> Since they work similarly to the "some" operatior, they have the same
> precedence.
>
s/operatior/operator/
> +
> + % In the usual case of a C backend, this predicate allows us to
> + % conclude that two insts are identical without traversing them.
> + % Since the terms can be very large, this is a big gain; it can
> + % turn the complexity of printing a checking from quadratic in the
> + % number of variables live at the checkpoint (when the variables
> + % are e.g. all part of a single long list) to linear. The minor
> + % increase in the constant factor in cases where identical_insts fails
> + % is much easier to live with.
> +
> +:- pred identical_insts((inst)::in, (inst)::in) is semidet.
> +
> +identical_insts(_, _) :-
> + semidet_fail.
> +
> +:- pragma foreign_proc("C",
> + identical_insts(InstA::in, InstB::in),
> + [will_not_call_mercury, will_not_throw_exception, promise_pure],
The `will_not_throw_exception' annotation here is redundant.
> +"
> + if (InstA == InstB) {
> + SUCCESS_INDICATOR = MR_TRUE;
> + } else {
> + SUCCESS_INDICATOR = MR_FALSE;
> + }
> +").
>
Julien.
--------------------------------------------------------------------------
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