src/Pure/General/properties.ML
author wenzelm
Wed, 07 Mar 2012 19:32:52 +0100
changeset 46829 9770573e2172
parent 43780 2cb2310d68b6
child 46830 224d01fec36d
permissions -rw-r--r--
simplified signature (NB: interpretation of properties is mainly done via XML.Encode/Decode);

(*  Title:      Pure/General/properties.ML
    Author:     Makarius

Property lists.
*)

signature PROPERTIES =
sig
  type entry = string * string
  type T = entry list
  val defined: T -> string -> bool
  val get: T -> string -> string option
  val put: entry -> T -> T
  val remove: string -> T -> T
end;

structure Properties: PROPERTIES =
struct

type entry = string * string;
type T = entry list;

fun defined (props: T) name = AList.defined (op =) props name;
fun get (props: T) name = AList.lookup (op =) props name;
fun put entry (props: T) = AList.update (op =) entry props;
fun remove name (props: T) = AList.delete (op =) name props;

end;