[mercury-users] Re-ordering and getters/setters

Jonathan Morgan jonmmorgan at gmail.com
Thu Aug 3 14:48:19 AEST 2006


If I have a foreign type that is accessed with a getter, and can be
affected by various operations with side-effects hidden in the I/O
state, is it safe to use a non-IO getter, as the getter is guaranteed
not to affect the state of the object and would therefore be pure
without the IO state, or should both getters and operations on the
object take the I/O state, just to ensure that the getters and setters
happen in the expected order?

It would seem to me that Obj^property is a much more natural way of
expressing things than object_get_property(Obj, Prop, !IO), so I would
prefer to use it, but only so long as it does not lead to unexpected
results due to re-ordering.

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