fork download
  1. type 'a _list = Nil | Cons of 'a * 'a _list
  2. exception EmptyListException
  3. let push xs x = Cons(x, xs)
  4. let pop = function Nil -> raise EmptyListException | Cons (x, c) -> (x, c)
  5. let rec each f = function Nil -> () | Cons (x, xs) -> f x; each f xs
  6. let x, xs = pop (push (push (push Nil 1) 2) 3)
  7. let () = print_int x; each print_int xs
Success #stdin #stdout 0s 4500KB
stdin
Standard input is empty
stdout
321