method field ?n name value =
    let args = match n with
        None -> [sv_of_string name; sv_of_string value]
      | Some n -> [sv_of_string name; sv_of_string value; sv_of_int n] in
    call_method_void sv "field" args