Abstract

The visitor pattern is a well-known design pattern for separating operations from the data structure. However, the visitor pattern has been criticized for its verbosity and inextensibility. To solve this problem, we develop a metaprogramming framework called Castor that facilitates programming with extensible, generative visitors. In this talk, we will show some applications of Castor, including open pattern matching, embedded domain-specific languages and graphs. The effectiveness of Castor is revealed by our case studies on TAPL interpreters and UML activity diagrams.