[m-dev.] Commas considered optional

Fergus Henderson fjh at cs.mu.OZ.AU
Thu Nov 29 19:36:27 AEDT 2001


On 29-Nov-2001, David Overton <dmo at cs.mu.OZ.AU> wrote:
> On Thu, Nov 29, 2001 at 03:50:48PM +1100, Ralph Becket wrote:
> > A common topic for debate is how to improve the syntax of Mercury.
> > Possibly for the first time ever in the history of such discussions, we
> > suggest taking something out: the commas.
> 
> This proposal might be desirable for conjunctions where you
> typically use a newline between conjuncts so the removal of the comma
> wouldn't make a huge difference to the ``visual parsing'' of the program.
> However, in the example you give above, eliminating the commas between
> arguments makes the code harder to read, IMHO.

Commas occur in three places in the Mercury term syntax:
in functor arguments (e.g. `f(a,b)'), in lists (e.g. `[1,2|_]'),
and as ordinary operators (e.g. `a,b' -- this category includes
both conjunctions and also data terms such as pairs that are
represented using ','/2).

It would be easy to allow juxtaposition as an alternative
to commas in only one or two of these three places.

(I'm just commenting on the technical feasibility;
I'm undecided on the desirability ;-)

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