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

Ralph Becket rafe at cs.mu.OZ.AU
Fri Mar 3 15:18:02 AEDT 2006


Peter Schachte, Friday,  3 March 2006:
> On Fri, Mar 03, 2006 at 02:10:15PM +1100, Ralph Becket wrote:
> > Of course, it's even easier if you think of a textual name and stick
> > with the usual convention...
> 
> Perhaps Mercury's designers should do the same?  The langauge is chock
> full of extra little bits of syntax for this or that, all of which
> make programming easier at the cost of complicating the language.  As
> many as possible of these should be defined in the library.  The lack
> of syntax extension and program transformation (cf term_expansion/2)
> facilities in Mercury mean they all have to be wired into the
> language.  Some examples:
> 
> 	@ syntax in pattern matching
> 	named field declaration and accessor and setter syntax
> 	state variables
> 	DCGs

The rate at which these were added to a developing language was Very
Slow.  They were also added after a great deal of consideration and
experience.  Finally, they are *standard* parts of the language, so
one would expect a Mercury programmer to be familiar with them.

This is not the case for the ad hoc use of op/3 that you desire.

> I'm sure there are more; I just found these by looking at the built-in
> op list (a huge list!).  How much simpler would the language be if
> these parts were part of the library instead of the langauge?

The language would be more complicated because there would be new
syntax introduced by every nth new module.  It'd be Babel.

> My point is the Mercury language designers feel no compunction about
> introducing new operators.  Why deny the same flexibility to users?

To the contrary, we are very reluctant to add new operators without
a great deal of consideration.  Also, the very rare additions we make
benefit all Mercury users, not one single application.

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