more abstract datatype stamp, which avoids pointless allocation of mutable cells;
authorwenzelm
Thu, 24 Nov 2011 21:15:20 +0100
changeset 45626 b4f374a45668
parent 45625 750c5a47400b
child 45627 a0336f8b6558
more abstract datatype stamp, which avoids pointless allocation of mutable cells;
src/Pure/library.ML
--- a/src/Pure/library.ML	Thu Nov 24 21:01:06 2011 +0100
+++ b/src/Pure/library.ML	Thu Nov 24 21:15:20 2011 +0100
@@ -212,11 +212,11 @@
   val partition_eq: ('a * 'a -> bool) -> 'a list -> 'a list list
   val partition_list: (int -> 'a -> bool) -> int -> int -> 'a list -> 'a list list
   val legacy_gensym: string -> string
-  type stamp = unit Unsynchronized.ref
-  val stamp: unit -> stamp
   type serial = int
   val serial: unit -> serial
   val serial_string: unit -> string
+  eqtype stamp
+  val stamp: unit -> stamp
   structure Object: sig type T = exn end
   val cd: string -> unit
   val pwd: unit -> string
@@ -1068,15 +1068,15 @@
 end;
 
 
-(* stamps and serial numbers *)
-
-type stamp = unit Unsynchronized.ref;
-val stamp: unit -> stamp = Unsynchronized.ref;
+(* serial numbers and abstract stamps *)
 
 type serial = int;
 val serial = Multithreading.serial;
 val serial_string = string_of_int o serial;
 
+datatype stamp = Stamp of serial;
+fun stamp () = Stamp (serial ());
+
 
 (* generic objects *)