let getd d (r, name) = match !r with
    | None -> d
    | Some v -> v