let rec reverse = function
  lx -> if is_empty_list (lx)
           then empty_list ()
           else end_cons_list (head (lx), reverse (tail (lx)))