let split_list len l =
  let rec iter accf acc = function
      [] ->
        (
         match acc with
           [] -> List.rev accf
         | _ -> List.rev ((List.rev acc) :: accf)
        )
    | h :: q ->
        if List.length acc >= len then
          iter ((List.rev acc) :: accf) [h] q
        else
          iter accf (h :: acc) q
  in
  iter [] [] l