As far as I know, there is no way to return elements from an array in the order in which they were added without tracking the insertion order. The best way to get the behavior you want is to use a dictionary , not an array. the dict really preserves the insertion order and as a bonus, with which they work much better when you pass them to or from procs.
source share