Pattern Matching in Encore
Encore is a young object-oriented programming language. The standard object-oriented model which embraces encapsulation works well for many kinds of problems but not all; it does not perform well when the algorithm inherently demands many objects to be decomposed at once. To address the need for an...
Main Author: | |
---|---|
Format: | Others |
Language: | English |
Published: |
Uppsala universitet, Institutionen för informationsteknologi
2016
|
Online Access: | http://urn.kb.se/resolve?urn=urn:nbn:se:uu:diva-294513 |
Summary: | Encore is a young object-oriented programming language. The standard object-oriented model which embraces encapsulation works well for many kinds of problems but not all; it does not perform well when the algorithm inherently demands many objects to be decomposed at once. To address the need for an elegant way to write programs that solve such problems we have extended Encore with a pattern matching construct capable of decomposing objects. This thesis recounts how we designed and implemented pattern matching in Encore and presents some examples of how it can be used. We found that for problems that are not well suited for fully encapsulated objects, pattern matching leads to much more concise and clean code. However, this comes at the cost of additional run-time. |
---|