Visitor Pattern

A pattern for traversing a tree of heterogeneous objects. Decoupling the algorithm for traversing the tree and the code operating on the objects leads to a much cleaner (and easily extensible) code.

Example usages include traversing an AST, the AST does not need to be changed to accomodate new code that is operating on it e.g. linters.