let set a i x =
  ensure a i;
  a.table.(i) <- x