Write access to an array of pointers to structure

I would like to allow a function to write into an array of non-primitive \objects. I can write into array using
\array_range function and into structure accessible via pointer using
\span (or \extent). But how can I do both all together? The annotations cannot be combined, because each of both takes
\object as its first parameter, but they return \objset.

Any idea? I was thinking that I would create a pure function and put there for loop to fill a
\objset using \set_union function, but unfortunately I cannot use for loop construct inside pure function. I miss some functionality to create, edit, and iterate over the array or set.