Remix.run Logo
kazinator 3 hours ago

Example of open recursion: add a new object type into a low-level language run time.

You implement a garbage traversal routine for it, which recurses over traversing the child objects.

The system is open to extension; the garbage collector doesn't just have a switch statement to handle all the known objects. It may have that too, but for some object kinds, it dispatches their method.