open Printf let test_cell c = printf "c = %d\n" (Cell.get c); flush stdout; printf "set c to 42... "; flush stdout; Cell.set c 42; printf "c = %d\n" (Cell.get c); flush stdout; try printf "set c to -1... "; flush stdout; Cell.set c (-1); with e -> begin print_endline (Printexc.to_string e); flush stdout end let () = print_endline "Start..."; flush stdout; test_cell (Cell.create 271828); Gc.full_major(); print_newline(); flush stdout; test_cell (Cell.global()); print_newline(); flush stdout; Gc.full_major() let () = let c1 = Cell.create 233 and c2 = Cell.create 234 in if c1 = c2 then printf "c1 = c2\n" else if c1 < c2 then printf "c1 < c2\n" else if c1 > c2 then printf "c1 > c2\n" else printf "What?!\n"