[mercury-users] Request for comments on this code
Peter Schachte
schachte at csse.unimelb.edu.au
Mon Jul 10 17:54:31 AEST 2006
On Mon, Jul 10, 2006 at 05:40:35PM +1000, Peter Moulder wrote:
> On Mon, Jul 10, 2006 at 04:39:36PM +1000, Peter Schachte wrote:
> > Being pure should mean the program
> > behaves deterministically, and clock doesn't.
>
> Surely this is just the same as many other I/O calls (read,
> gettimeofday, etc.) returning values that depend on when the call is
> made.
But you really can't safely consider the time of day to be part of the
IO state, because goals that can affect the time of day (by taking
some computation time) don't have to take an IO state argument. And
the same goal executed at the same time on two different computers in
the same environment won't necessarily take the same amount of time.
Time is like the size heap: changes to it cannot be safely measured
in pure code, because pure code is allowed to side-effect them.
--
Peter Schachte What we are looking at is good and evil, right
schachte at cs.mu.OZ.AU and wrong. A new world order!
www.cs.mu.oz.au/~schachte/ -- George Bush
Phone: +61 3 8344 1338
--------------------------------------------------------------------------
mercury-users mailing list
post: mercury-users at csse.unimelb.edu.au
administrative address: owner-mercury-users at csse.unimelb.edu.au
unsubscribe: Address: mercury-users-request at csse.unimelb.edu.au Message: unsubscribe
subscribe: Address: mercury-users-request at csse.unimelb.edu.au Message: subscribe
--------------------------------------------------------------------------
More information about the users
mailing list