[mercury-users] Field updates and state variables (more)

Nicholas Nethercote njn at csse.unimelb.edu.au
Wed Jul 19 01:12:38 AEST 2006


Hi,

Peter Hawkins recently proposed this syntax for updating fields in state 
variables:

   map.insert(Key, Value, !S ^ my_map)

to mean this:

   map.insert(Key, Value, !.S ^ my_map, Temp),
   !:S = !.S ^ my_map := Temp,

I just hit exactly the same thing.  The former is exactly what I tried 
writing, and the latter is what I eventually managed to get the compiler to 
accept.  Unfortunately the latter is so verbose that I may just end up 
passing around the three elements that constitute my "state" type 
separately, rather than bundling them into a record.

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