src/Pure/General/properties.ML
author wenzelm
Wed, 27 Aug 2008 16:32:48 +0200
changeset 28023 92dd3ad302b7
parent 28019 359764333bf4
child 28032 cb0021c989cd
permissions -rw-r--r--
simplified parse_attrib (find_substring instead of space_explode);

(*  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;