]> Joshua Wise's Git repositories - snipe.git/blobdiff - trans/stringref.sml
Emit strings at the end.
[snipe.git] / trans / stringref.sml
index f78bd95c71330c11695e6dcf16ee0ba623855799..978d4a36ca572a1bf6fb7d710313bcd5f15fa51d 100644 (file)
@@ -12,6 +12,7 @@ sig
   val new : string -> stringref        (* returns a unique new stringref *)
   val name : stringref -> string       (* returns the name of a stringref *)
   val compare : stringref * stringref -> order (* comparison function *)
+  val all : unit -> (stringref * string) list
 end
 
 structure Stringref :> STRINGREF = 
@@ -25,6 +26,7 @@ struct
     (* warning: calling reset() may jeopardize uniqueness of stringrefs! *)
     fun reset () = ( counter := 1 ; strings := [] )
     fun new (s : string) = !counter before ( strings := (!counter, s) :: !strings ; counter := !counter + 1 )
+    fun all () = !strings
   end
 
   fun name t = "S" ^ Int.toString t
This page took 0.018862 seconds and 4 git commands to generate.