[m-rev.] Added int:'/'/2 and builtin false/0

Ralph Becket rafe at cs.mu.OZ.AU
Mon May 20 17:58:42 AEST 2002


Fergus Henderson, Monday, 20 May 2002:
> On 20-May-2002, Ralph Becket <rafe at cs.mu.OZ.AU> wrote:
> > I just think that '//'/2 is an anachronism that makes Mercury harder for
> > newcomers to read and understand
> 
> Calling it an _anachronism_ would imply that there was some reason
> which justified its used in the past but which is no longer valid.
> I don't think that is the case.  AFAIK the reasons for choosing '//'
> rather than '/' are just as valid now as they ever were.

No non-Prolog based language I can think of since Prolog's inception in
1971 has adopted the practice.

Other languages seem to get by just fine using '/'/2.  It's not clear
that there's any evidence that forcing the use of '//'/2 leads to
programs with fewer bugs in integer code in Prologesque languages.

The reasoning behind the choice of '//' was not extended to naming the
other arithmetic operators.

It is an obstacle to readability for programmers not familiar with
Prolog.  It is often an annoyance to those that are, yet forget this
case.

On pragmatic grounds, I'd argue that supporting '/'/2 is sensible,
regardless of the intention behind the choice of '//'/2.

> > (currently, if you inadvertently use
> > '/'/2, the compiler simply reports "error: undefined symbol `//2'",
> > which is really not very helpful if you don't know the history...)
> 
> It would be easy to provide a better error message...

It would be easier to add '/'/2!

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