let rec length = function
  lx -> if is_empty_list (lx) 
          then 0 
          else 1 + length (tail (lx))