Sciweavers

OOPSLA
2007
Springer

OOMatch: pattern matching as dispatch in Java

13 years 10 months ago
OOMatch: pattern matching as dispatch in Java
We present a new language feature, specified as an extension to Java. The feature is a form of dispatch which includes and subsumes multimethods (see for example [3]), but which is not as powerful as general predicate dispatch [7]. It is, however, intended to be more practical and easier to use than the latter. The extension, dubbed OOMatch, allows method parameters to be specified as patterns, which are matched against the arguments to the method call. When matches occur, the method applies; if multiple methods apply, the method with the more specific pattern overrides the others. The pattern matching is very similar to that found in the “case” constructs of many functional languages (ML [12], for example), with an important difference: functional languages normally allow pattern matching over variant types (and other primitives such as tuples), while OOMatch allows pattern matching on Java objects. Indeed, the wider goal here is the study of the combination of functional and ...
Adam Richard, Ondrej Lhoták
Added 08 Jun 2010
Updated 08 Jun 2010
Type Conference
Year 2007
Where OOPSLA
Authors Adam Richard, Ondrej Lhoták
Comments (0)