+let list_visit before each after string_of p l =
+ let ptr p = string_of_pointer (List.rev p) in
+ let rec aux i = function
+ | [] -> ()
+ | (b, x)::tl ->
+ each (ptr (i::p)) b (string_of x);
+ aux (succ i) tl
+ in
+ let s, c = list_count 0 0 l in
+ let count = Printf.sprintf "%u/%u" s c in
+ before (ptr p) count;
+ aux 0 l;
+ after ()
+