Example of Complication (2)
In ML:let val r:int ref = ref 3in !r + !r + !rend (* evaluates to 9 *)
In CML:let val c:int chan = channel() val _ = spawn(fn()=>send(c, 3)) in recv(c) + recv(c) + recv(c))end (* evaluation gets stuck! *)
Previous slide
Next slide
Back to first slide
View graphic version