[m-dev.] Suggestion for a new "where" operator

Ralph Becket rafe at cs.mu.OZ.AU
Thu Aug 7 13:42:29 AEST 2003


Peter Moulder, Thursday,  7 August 2003:
> 
> [Interestingly, the two versions of the goal can have different
>  determinisms (or even produce a mode error in the duplicate-where
>  version) if the first p call changes the instantiatedness of X.  E.g. if
>  (p(out) is det) is chosen for the initial p(X) call (i.e. p(free >>
>  ground) is det), then the second p(X) call in the duplicate-where
>  version can resolve to (p(in) is semidet), and the compiler may
>  (over-cautiously) complain that the goal can fail.]

And this, I think, is the show-stopper for the approach where
X = (E where G) is shorthand for (some minor variation of)
(G, X = E) in which G binds variables in E and possibly elsewhere.

The suggestion that (E where G) = apply((func) = E :- G) would cover all
the cases where I have wanted something like where-expressions.

-- Ralph
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list