Or let split l n = let rec aux acc l n = if n = 0 then List.rev acc, l else match l with [] -> List.rev acc, [] | hd::l -> aux (hd::acc) l (n-1) in aux [] l n This is tail recursive, it does not use magic nor references and keed the original ordering of the list. Finally, I did in the past some testing comparing a tail-rec append or map using magic and the composition of rev and rev-append or rev-map ... There was no noticable difference, because the extra cost of mutability (regarding the managment of the grey val list) compensate the extra call to reverse. So I think I would write split the way shown above if ordering matters. Cheers, Christophe > > Alain > > _______________________________________________ > Caml-list mailing list. Subscription management: > http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list > Archives: http://caml.inria.fr > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs