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

Fergus Henderson fjh at cs.mu.OZ.AU
Fri May 17 16:44:58 AEST 2002


On 17-May-2002, Ralph Becket <rafe at cs.mu.OZ.AU> wrote:
> NEWS:
> 	Record addition of int:'/'/2 as a synonym for int:'//'/2 and
> 	builtin false/0 as a synonym for fail/0.
> 
> library/int.m:
> 	Added '/'/2.
> 
> library/builtin.m:
> 	Added false/0.

The change to add false/0 is fine.
But I don't think we should add '/'/2, unless it is real
division, i.e. unless it has type `:- func int / int = float'
or `:- func int / int = rational'.
In mathematics, '/' is division, not truncating integer division.
Truncating integer division is really a rather different operation
than real division, and so I think it makes sense to use a different
operator for that.

> +* We've added int:'/'/2 as a synonym for int:'//'/2 and false/0 as a
> +  built-in synonym for fail/0 (both left-overs from Mercury's Prolog
> +  heritage.)

In Prolog, the design rationale for using the imperative name fail/0
was because it was generally used in an imperative style.
This is usually not the case in Mercury, so yes, it makes sense to add
`false' as a synonym.

But I think the reasons for Prolog to use '//' for truncating integer
division still apply equally well for Mercury.

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