[m-rev.] for review: make get_functor handle existential types
Ralph Becket
rafe at cs.mu.OZ.AU
Mon Dec 13 14:25:54 AEDT 2004
Zoltan Somogyi, Monday, 13 December 2004:
> library/list.m:
> Add two general-purpose predicates, all_true and all_false,
> for use in the other library modules.
Are these really that useful?
> +list__all_true(_P, []).
> +list__all_true(P, [X | Xs]) :-
> + P(X),
> + list__all_true(P, Xs).
> +
> +list__all_false(_P, []).
> +list__all_false(P, [X | Xs]) :-
> + not P(X),
> + list__all_false(P, Xs).
Is there any efficiency difference between the above and these?
all [X] ( member(X, Xs) => P(X) )
and
all [X] ( member(X, Xs) => not P(X) )
Stylistically, I prefer the latter.
-- 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