[m-dev.] trivial diff: parenthesize `instance' and `typeclass'

Fergus Henderson fjh at cs.mu.OZ.AU
Wed Nov 8 04:11:55 AEDT 2000


On 31-Oct-2000, Simon Taylor <stayl at cs.mu.OZ.AU> wrote:
> 
> > compiler/mercury_to_mercury.m:
> > 	Add `typeclass' and `instance' as mercury_unary_prefix_ops,
> > 	to ensure that we parenthesize them when necessary.
>  
> > Index: compiler/mercury_to_mercury.m
> > ===================================================================
> > @@ -2966,6 +2966,7 @@
> >  mercury_unary_prefix_op("include_module").
> >  mercury_unary_prefix_op("impure").
> >  mercury_unary_prefix_op("insert").
> > +mercury_unary_prefix_op("instance").
> >  mercury_unary_prefix_op("inst").
> >  mercury_unary_prefix_op("lib").
> >  mercury_unary_prefix_op("listing").
> 
> Can't this be done using ops__lookup_prefix_op, to avoid the
> double maintenance problem?

Good question.  I think the answer is now yes.
I think originally there was some reason relating to our use of 
Prolog implementations to run Mercury code (in particular I think
mercury_to_mercury.m would escape all NU-Prolog operators, to ensure
that the result worked in NU-Prolog, but ops.m listed mainly just
the Mercury operators, and omitted most of the NU-Prolog ones.)
But now that we don't use Prolog, I think that reason is no longer relevant.

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