method add : 'a. 'a cp -> unit = fun original_cp ->
let cp = (original_cp :> groupable_cp) in
let add_immediate name cp queue =
Queue.iter (fun (name',_) -> if name = name' then raise Double_name) queue;
Queue.push (name, Immediate cp) queue in
let rec add_in_section section first_name last_name cp queue =
let sub_add = match last_name with
| [] -> add_immediate first_name
| middle_name :: last_name -> add_in_section first_name middle_name last_name in
try
Queue.iter
(function
| name, Subsection subsection when name = section ->
sub_add cp subsection; raise Found
| _ -> ())
queue;
let sub_queue = Queue.create () in
sub_add cp sub_queue;
Queue.push (section, Subsection sub_queue) queue
with Found -> () in
(match cp#get_name with
| [] -> failwith "empty name"
| first_name :: [] -> add_immediate first_name cp cps
| first_name :: middle_name :: last_name ->
add_in_section first_name middle_name last_name cp cps)