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

Mark Brown mark at cs.mu.OZ.AU
Sat Mar 4 17:39:02 AEDT 2006


On 04-Mar-2006, Peter Schachte <schachte at csse.unimelb.edu.au> wrote:
> On Sat, Mar 04, 2006 at 01:07:01AM +1100, Mark Brown wrote:
> > On 04-Mar-2006, Peter Schachte <schachte at csse.unimelb.edu.au> wrote:
> > > > At least with the current scheme you won't find the compiler reporting
> > > > strange new syntax errors in a previously working module just because
> > > > you added an import_module directive.
> > > 
> > > That wouldn't happen.
> > 
> > I'm afraid it would.  If you've used a nullary function symbol and you
> > import a module that defines a unary operator with that name, you will
> > need to enclose it in parentheses.
> 
> Not if your reader is coded correctly.

You can observe the error already by using an existing prefix operator
but not enclosing it in brackets.  For example, the 0.12 release of the
compiler uses the type `type/0' for representing types.  It contains
declarations such as:

	:- pred prog_type.vars((type)::in, list(tvar)::out) is det.

which need the parentheses, otherwise it is an operator precedence error.

You can also observe the problem if you have a module named `solver' and
try to write:

	:- module solver.

or
	:- import_module solver.

Whether or not this is the bug you were referring to, I'm not sure.

Cheers,
Mark.

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