fn generate_subscripts_iterator( array: ListRef<'_>, dim: i32, reverse: bool, ) -> impl Iterator<Item = i32>