[m-dev.] 0.13 release: op/3 syntax

Peter Moulder Peter.Moulder at infotech.monash.edu.au
Sat Mar 4 17:15:30 AEDT 2006


On Fri, Mar 03, 2006 at 06:33:22PM +1100, Peter Schachte wrote:
> On Fri, Mar 03, 2006 at 02:36:15PM +1100, Ralph Becket wrote:
> > And I suggest this also be motivated by plenty of examples.
> 
> Good idea.  I gave an example of defining *** as a prefix operator
> that could be placed in the left margin of code to trace it.  You
> could do without it, but you'd have to wrap and unwrap goals with
> parentheses whenever you changed your mind about what to trace (which
> was often for me).

I believe the particular example Peter gave (where the argument of '***'
was an arbitrary goal) wouldn't work in Mercury.  Also, regarding that
particular example, debugging the debugger isn't a particularly good use
case to justify adding something permanently to the language.  As Peter
suggest, the usual approach is to use debugger breakpoints.
[Incidentally, customizable breakpoint actions, as found in Morphine
 (extras directory: http://www-verimag.imag.fr/~jahier/morphine.html)
 or gdb (*see (gdb)Break Commands), are especially useful here.]

> I'd like to be able to use 'in' as an infix operator for list and set
> membership.

You can already use `member`.

> I've implemented a bounded universal quantifier for Prolog that used
> the syntax
> 
> 	forall Template in Sequence :: Goal

I'm not sure what the above does.  Mercury already allows

  ( all[X] X `member` Sequence => Goal(X) )


(Btw, I take no position on whether user-defined operators should or
shouldn't be in the language, I'm just making sure our reasons are
good.)

pjrm.
--------------------------------------------------------------------------
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