Refs can change a value held in a variable, but they can’t change the structure of a list for example they can’t delete elements from a list. Sounds like you really want to use a vector data type. A vector is basically an array which automatically manages changing its own size for you. E.g. you can use https://github.com/gsg/ocaml-vector/ , it has a function
Vector.remove_if which sounds like exactly what you need.
One more thing I’d add is that if you’re mutating the input vector,
get_younger is no longer an appropriate name for the operation, I would recommend changing it to something that makes the mutation more obvious, e.g.
keep_younger or even