let load_sexps_conv ?(buf = String.create 8192) file f =
let rev_sexps = load_rev_sexps ~buf file in
try List.rev_map (fun sexp -> `Result (f sexp)) rev_sexps
with Of_sexp_error _ as e ->
match Annotated.load_rev_sexps ~buf file with
| [] ->
(* File is now empty - perhaps it was a temporary file handle? *)
raise e
| rev_annot_sexps ->
List.rev_map (fun annot_sexp -> Annotated.conv f annot_sexp)
rev_annot_sexps