[m-dev.] Commas considered optional

Simon Taylor stayl at cs.mu.OZ.AU
Fri Nov 30 01:02:29 AEDT 2001


On 29-Nov-2001, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> 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.

I agree.

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

My preference would be to only allow juxtaposition where ','/2 is
being used as an ordinary operator.

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