Matching Objects With Patterns. Burak Emir, Martin Odersky, and John Williams.
Data in object-oriented programming is organized in a hierarchy of classes. The problem of object-oriented pattern matching is how to explore this hierarchy from the outside. This usually involves classifying objects by their run-time type, accessing their members, or determining some other characteristic of a group of objects. In this paper we compare six different pattern matching techniques: object-oriented decomposition, visitors, type-tests/typecasts, typecase, case classes, and extractors. The techniques are compared on nine criteria related to conciseness, maintainability and performance. The paper introduces case classes and extractors as two new pattern-matching methods and shows that their combination works well for all of the established criteria.
Recent comments
10 min 31 sec ago
24 min 22 sec ago
1 hour 34 min ago
7 hours 21 min ago
7 hours 25 min ago
7 hours 31 min ago
10 hours 23 sec ago
11 hours 35 min ago
12 hours 17 min ago
12 hours 27 min ago