[mercury-users] string comparisons

Julien Fischer juliensf at csse.unimelb.edu.au
Fri Jan 25 13:34:29 AEDT 2008


On Fri, 25 Jan 2008, Nicholas Nethercote wrote:

> On Thu, 24 Jan 2008, Julien Fischer wrote:
>
>>> I don't see any predicates to compare strings in the 'string' library. 
>>> Does the built-in string comparison do lexicographical ordering?
>> 
>> The builin string comparison just calls strcmp() in the C grades,
>
> Can I rely on this?  It's not documented, as far as I can see.

It probably should be - I'll add something to the library documentation.

> Given how many operations there are in the string library, I was surprised 
> that no comparison operation is (obviously) in there.

All Mercury types have equality and comparison defined for them 
automatically.

Julien.
--------------------------------------------------------------------------
mercury-users mailing list
Post messages to:       mercury-users at csse.unimelb.edu.au
Administrative Queries: owner-mercury-users at csse.unimelb.edu.au
Subscriptions:          mercury-users-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the users mailing list