I understand that to create objects with custom behavior with respect to existing code one uses upvalues. However, I'm at loss when it comes to guess what interface is expected from objects fed to built-in functions.
As a practical example, I would like to create a custom object
DiskList that doesn't store its values in memory but dynamically reads them from a file. It is easy enough to write an upvalue for it so that the expression
mydisklist[] works as expected, but how do I make such object able to be passed to