3 * Author: Kaustuv Chaudhuri <kaustuv+@cs.cmu.edu>
4 * Modified: Alex Vaynberg <alv@andrew.cmu.edu>
5 * Modified: Frank Pfenning <fp@cs.cmu.edu>
12 val reset : unit -> unit (* resets temp numbering *)
13 val new : unit -> temp (* returns a unique new temp *)
14 val name : temp -> string (* returns the name of a temp *)
15 val compare : temp * temp -> order (* comparison function *)
18 structure Temp :> TEMP =
25 (* warning: calling reset() may jeopardize uniqueness of temps! *)
26 fun reset () = ( counter := 1 )
27 fun new () = !counter before ( counter := !counter + 1 )
30 fun name t = "+t" ^ Int.toString t
32 fun compare (t1,t2) = Int.compare (t1,t2)