[m-dev.] Ordered conjunction

Fergus Henderson fjh at cs.mu.OZ.AU
Fri Aug 25 14:55:15 AEST 2000


On 24-Aug-2000, Erwan Jahier <Erwan.Jahier at irisa.fr> wrote:
> Ralph Becket <rbeck at microsoft.com> writes:
> 
> > I know this has come up before, but I just want to restate the case
> > for an ordered conjunction (P && Q) which constrains the compiler to
> > call P before Q (for && pick the symbol of your choice).
> 
> What about `then'? It seems to me that it a degenerated case of
> if-then-else where there is no `else' branch (or where the `else'
> branch it equivalent to `fail').  

You're right about the semantics of `P && Q' being the same
as `if P then Q else fail' or `P -> Q ; fail'.

> > Would this be easy to add to the language?

A simplistic implementation which just treated it as a syntactic
abbreviation for if-then-else would be pretty trivial.  If we can
get a concensus on the syntax, I'd be happy to do that.

(Adding a new alternative to the mlds__goal type would be fairly
straight-forward, but would require modifying quite a lot of code.
Doing it this way will probably be necessary at some point, but in the
short term we can get away without it.)

> > It's probably not a high priority thing, but I reckon it's a wart
> > that should be fixed

I agree.

> > for 1.0.

It would be nice if it gets done by the time we release 1.0,
but it is not part of the original design goals for 1.0, and personally
I'll resist any attempt to add new design goals for 1.0 at this point.
After all, this is not an essential feature; it's just a syntactic nicety
rather than a necessity.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3        |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
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