[m-dev.] call for opinions on promise_same_solutions syntax

Peter Schachte schachte at csse.unimelb.edu.au
Thu Mar 2 13:44:36 AEDT 2006


On Thu, Mar 02, 2006 at 01:05:05PM +1100, Zoltan Somogyi wrote:
> On 02-Mar-2006, Peter Schachte <schachte at csse.unimelb.edu.au> wrote:
> >         promise_equivalent_solution_sets [Vars] (
> >                 whichever [Vars1] Goal1,
> >                 whichever [Vars2] Goal2,
> > 		...
> > 		Goal
> >         )
> 
> I think that proposal is a distinct improvement over all the earlier ones.
> I am ready to implement it, with one exception: the keywords.
> 
> I think "whichever" sounds too much like "whatever", which is what you say
> when you want to blow someone off :-(

Not surprising:  you're blowing off alternatives.  But I agree it
sounds a bit informal.

How about 'forany' or just 'any'?

> "promise_equivalent_solution_sets" is ok, but it is very long; you can't
> actually write that if the original code is already significantly indented
> or you have long variable names in the list. I propose that we use the
> keyword "promise_same_solutions", which means the same, but is shorter.

What bothered me about that one was that it sounds equivalent to
'promise_equivalent_solutions'.  The *name* doesn't give a clue as to
the distinction between the two.

But note that this new feature subsumes promise_equivalent_solutions:

	promise_equivalent_solutions [Vars] Goal 

is equivalent to

	promise_equivalent_solution_sets [Vars] forany [Vars] Goal

So if you take the variation at the end of my last message that drops
the [Vars] part and go with 'promise_same_solutions' and 'forany', you
have

	promise_same_solutions forany [Vars] Goal

which reads pretty well and has only one more character than the
current promise_equivalent_solutions syntax.  Then you could deprecate
and eventually remove promise_equivalent_solutions, reducing the
number of special language features relating to determinacy, and
avoiding confusion between promise_same_solutions and
promise_equivalent_solutions.

-- 
Peter Schachte              Even if you are a minority of one, the truth is
schachte at cs.mu.OZ.AU        the truth.
www.cs.mu.oz.au/~schachte/      -- Mahatma Gandhi 
Phone: +61 3 8344 1338      
--------------------------------------------------------------------------
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