src/Pure/General/properties.ML
changeset 28019 359764333bf4
child 28032 cb0021c989cd
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/Pure/General/properties.ML	Wed Aug 27 11:49:50 2008 +0200
@@ -0,0 +1,29 @@
+(*  Title:      Pure/General/properties.ML
+    ID:         $Id$
+    Author:     Makarius
+
+Property lists.
+*)
+
+signature PROPERTIES =
+sig
+  type property = string * string
+  type T = property list
+  val defined: T -> string -> bool
+  val get: T -> string -> string option
+  val put: string * string -> T -> T
+  val remove: string -> T -> T
+end;
+
+structure Properties: PROPERTIES =
+struct
+
+type property = string * string;
+type T = property list;
+
+fun defined (props: T) name = AList.defined (op =) props name;
+fun get (props: T) name = AList.lookup (op =) props name;
+fun put prop (props: T) = AList.update (op =) prop props;
+fun remove name (props: T) = AList.delete (op =) name props;
+
+end;