[m-rev.] Add `.' as a module separator.
Fergus Henderson
fjh at cs.mu.OZ.AU
Tue Dec 3 17:32:24 AEDT 2002
On 03-Dec-2002, Simon Taylor <stayl at cs.mu.OZ.AU> wrote:
> On 03-Dec-2002, Ralph Becket <rafe at cs.mu.OZ.AU> wrote:
> >
> > Added infix `.' as a module separator. This is paving the way to phasing
> > out `:' as a module separator in order to use it as a synonym for `with_type`
> > instead.
>
> You should also change the code to write module qualified terms.
> Grep for "\":\"" in the compiler source.
I agree; however, I would be happy for that to come as a separate change.
It would be OK for the compiler to support all three module qualifiers
as input and to output module-qualifiers as ":".
However, another thing that needs to be done is to document the change
in the language reference manual; that is something that I think should
be done as part of this change, not as a separate change.
> > Index: library/ops.m
> > +++ library/ops.m 2 Dec 2002 02:11:06 -0000
> > @@ -264,7 +264,7 @@
> > ops__op_table("--->", after, xfy, 1179). % Mercury extension
> > ops__op_table("-->", after, xfx, 1200). % standard ISO Prolog
> > ops__op_table("->", after, xfy, 1050). % standard ISO Prolog
> > -ops__op_table(".", after, xfy, 600). % traditional Prolog (not ISO)
> > +ops__op_table(".", after, yfx, 600). % traditional Prolog (not ISO)
>
> You should change the comment to mention that the associativity is
> different to ISO Prolog.
Different to traditional Prolog, I think you mean.
I think the precedence for `.' should be changed to something very low,
e.g. 10, rather than 600. For example, I should be able to write
two_pi = 2 * math.pi.
but with the current precedences, this would parse as
two_pi = (2 * math).pi.
--
Fergus Henderson <fjh at cs.mu.oz.au> | "I have always known that the pursuit
The University of Melbourne | of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh> | -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-reviews mailing list
post: mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------
More information about the reviews
mailing list