[mercury-users] Status of unique modes in Mercury?

Edsko de Vries devriese at cs.tcd.ie
Fri Jul 4 02:04:44 AEST 2008


Hi,

I was wondering about the status of unique modes in Mercury. In the
documentation for arrays in the standard library, I find

     % WARNING!
     %
     % Arrays are currently not unique objects - until this situation is
     % resolved it is up to the programmer to ensure that arrays are used
     % in such a way as to preserve correctness.  In the absence of mode
     % reordering, one should therefore assume that evaluation will take
     % place in left-to-right order.

Similarly for hash tables:

     % CAVEAT: the user is referred to the warning at the head of array.m
     % with regard to the current use of unique objects.  Briefly, the
     % problem is that the compiler does not yet properly understand
     % unique modes, hence we fake it using non-unique modes.
     % This means that care must be taken not to use an old version of a
     % destructively updated structure (such as a hash_table) since the
     % compiler will not currently detect such errors.

What exactly are the issues? Why are arrays not unique objects? And in what way
does the compiler "not yet properly understand unique modes"?

Thanks,

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