As a Roblox developer, it is currently too difficult to overload
ipairs. Backporting these metamethods would allow for user-made Abstract Data Types (ADT) to have custom traversal behaviour. Some examples of use cases are:
- Traversing user-made linked lists
- Custom traversal behaviour for user-made binary trees
- Custom traversal behaviour for user-made matrices
- Custom traversal behaviour for any other user-made ADT
In addition to ADTs, backporting the metamethods will allow you to traverse proxy tables that are designed to conceal behaviour from other tables. As it currently stands, the existing metamethods allow you to create a complete proxy for a table without being aware that the proxy exists, except when you try to iterate through that proxy table. The
__ipairs metamethods would solve this problem.
If Roblox is able to address this issue, it would improve my development experience because it would allow for simple and intuitive control over the traversal of ADTs and proxy tables. Currently, developers need to overload the
ipairs functions for each different type of use case if they want custom traversal, which is not a feasible solution for large projects.