(************************************************************************) (* v * The Coq Proof Assistant / The Coq Development Team *) (* raise Stack.Empty | x::xs -> l := xs; x let top l = match !l with [] -> raise Stack.Empty | x::_ -> x let find f i l = let rec aux i = function | [] -> raise Not_found | x::xs -> match f i x with `Stop x -> x | `Cont i -> aux i xs in aux i !l let is_empty l = match !l with [] -> true | _ -> false let iter f l = List.iter f !l let clear l = l := [] let length l = List.length !l let to_list l = !l