simpler Univ.unpack implementation

This commit is contained in:
Simon Cruanes 2013-05-24 13:44:44 +02:00
parent 93eb787082
commit 73073bdd0c

10
univ.ml
View file

@ -49,12 +49,10 @@ let embed () =
{ id = id; store = (fun () -> r := o); }
in
let unpack t = (* try to extract the content of a univ cell *)
if id == t.id then begin
t.store ();
let a = !r in
r := None;
a
end else None
r := None;
t.store ();
let a = !r in
a
in
let set t a = (* change, in place, the embedding and content of the cell *)
t.id <- id;