[mercury-users] List literals are falsely treated as being unique
Michael Day
mikeday at yeslogic.com
Mon Jan 5 19:19:58 AEDT 2009
Hi,
Mercury will accept that the literal list [1,2,3] is unique and allow me
to pass it to a predicate that accepts lists with mode di.
However, the list is stored as static data, in a non-writable page, so
the program will segfault if the list is actually modified.
This is similar to the issue affecting set_char on strings.
Summary: OUCH! Any program that performs destructive update on lists is
only one accidentally passed constant away from disaster.
Cheers,
Michael
--
Print XML with Prince!
http://www.princexml.com
--------------------------------------------------------------------------
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