[m-rev.] for review: user-defined comparison

Fergus Henderson fjh at cs.mu.OZ.AU
Sun Jul 14 03:21:04 AEST 2002


On 10-Jul-2002, Simon Taylor <stayl at cs.mu.OZ.AU> wrote:
> 
> Allow user-defined comparison functions using the syntax
> :- type t ---> t where equality is t_equal, comparison is t_compare.
>
> Allow user-defined equality and comparison for foreign types using the syntax
> :- pragma foreign_type(c, t, "c_t") where
> 		equality is t_equal, comparison is t_compare.


Whatïs the rationale for this change?

This solution is not a complete solution to the problem,
and it is not extensible.  For example, you still wonït be
able to serialize foreign types with io__write_binary,
or to display user-defined types (e.g. bitset) appropriately with io__print.

I think the right thing to do in the long run is to adopt an
extensible solution, and I donït think the syntax will look like
this syntax.  Is the problem that you are trying to solve really so
severe that we need to adopt a temporary kludge that we will eventually end
up replacing with something different?

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