[go: up one dir, main page]

File: state.mli

package info (click to toggle)
cduce 0.5.3-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 3,180 kB
  • ctags: 3,176
  • sloc: ml: 20,028; xml: 5,546; makefile: 427; sh: 133
file content (26 lines) | stat: -rw-r--r-- 828 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
(*
(* This module provides a minimal and unsafe support for
   saving/restoring the global state of the program.

   It assumes that the global state is fully described by
   Marshal'able references. 
*)

val ref: string -> 'a -> 'a ref
  (* Replacement for Pervasives.ref. Creates a persistant reference.
     Two runs of the programs must yield the same calls to this function,
     in the correct order. The arbitrary string argument is used to 
     check this order (give a different string for different calls).
  *)

val close: unit -> unit
  (* Close registration for the global state. When this function
     has been called, ref becomes illegal, and get/set become
     legal *)

val get: unit -> 'a
  (* Get a marshal'able value representing the global state *)

val set: 'a   -> unit
  (* Set the global state *)
*)