Am Mittwoch, den 01.10.2014, 06:29 -0400 schrieb oleg@okmij.org: > To understand the problem, let us recall the main principle stated > earlier: ``There are two ways the function call (flip 0.5) > can return: it can return with true or with false.'' That is, the > function call (flip 0.5) returns *twice*. Therefore, the call (f h) > in the let cell statement returns twice. Therefore, the assignment > dst.tl <- Obj.magic cell; > will be executed twice. And the second execution of that assignment > will be with a different cell, which will override and destroy the > result of the first assignment. That is how the "true" choices became > lost. IMHO this is irrelevant for the normal OCaml evaluation regime. The standard interpretation of a type 'a -> 'b is that it returns only once. There is no alternate local world. I don't know what Hansei is doing to get this effect, but it looks like it uses continuations, STM, or some other technique to checkpoint some state and restart from there. This technique is obviously not taking local state into account (which would also have to be duplicated), but this is a limitation of this technique. I don't think this is a valid argument against using hidden local state. It's more an argument that if you use such checkpointing techniques, you need to be extremely careful. Gerd > > > -- ------------------------------------------------------------ Gerd Stolpmann, Darmstadt, Germany gerd@gerd-stolpmann.de My OCaml site: http://www.camlcity.org Contact details: http://www.camlcity.org/contact.html Company homepage: http://www.gerd-stolpmann.de ------------------------------------------------------------