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