X-Git-Url: http://git.joshuawise.com/snipe.git/blobdiff_plain/a83f1d602c6f50eb9ab0448a20f0ecb80fefcead..e63d3705454c62fd1eff1c0c9cd78f042e621fbc:/trans/stringref.sml diff --git a/trans/stringref.sml b/trans/stringref.sml index f78bd95..978d4a3 100644 --- a/trans/stringref.sml +++ b/trans/stringref.sml @@ -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