exception LeereSchlange ;; exception EtwasIstFalsch ;; let init = ([],[]) ;; let nil x = (x=([],[])) ;; let enter = function (s,l) -> function x -> (s,x::l) ;; let rec kopieren = function (l,[]) -> l | (l,h::t) -> kopieren (h::l,t) ;; let hd = function ([],[]) -> raise LeereSchlange | (h::t,s) -> h | ([],s) -> match kopieren ([],s) with h::_ -> h | _ -> raise EtwasIstFalsch ;; let tl = function ([],[]) -> raise LeereSchlange | (h::t,s) -> (t,s) | ([],s) -> match kopieren ([],s) with _::t -> (t,[]) | _ -> raise EtwasIstFalsch ;;