MHN
Add a comment on Hacker News →
1 of 62 comments
  1. The visitor pattern is a way of getting multiple dispatch in a language with single dispatch.

    It can also be seen as a way of encoding a functional solution to the expression problem in an OO language, which is useful when you have a set of objects and want to make it easy to add new operations to them, not create new types of objects.