File Download

There are no files associated with this item.

  Links for fulltext
     (May Require Subscription)
Supplementary

Conference Paper: Pattern matching in an open world

TitlePattern matching in an open world
Authors
Issue Date2018
PublisherAssociation for Computing Machinery (ACM).
Citation
Proceedings of the 17th ACM SIGPLAN International Conference on Generative Programming: Concepts and Experiences (GPCE 2018), Boston, MA, USA, 5-6 November 2018, p. 134-146 How to Cite?
AbstractPattern matching is a pervasive and useful feature in functional programming. There have been many attempts to bring similar notions to Object-Oriented Programming (OOP) in the past. However, a key challenge in OOP is how pattern matching can coexist with the open nature of OOP data structures, while at the same time guaranteeing other desirable properties for pattern matching. This paper discusses several desirable properties for pattern matching in an OOP context and shows how existing approaches are lacking some of these properties. We argue that the traditional semantics of pattern matching, which is based on the order of patterns and adopted by many approaches, is in conflict with the openness of data structures. Therefore we suggest that a more restricted, top-level pattern matching model, where the order of patterns is irrelevant, is worthwhile considering in an OOP context. To compensate for the absence of ordered patterns we propose a complementary mechanism for case analysis with defaults, which can be used when nested and/or multiple case analysis is needed. To illustrate our points we develop Castor: a meta-programming library inScala that adopts both ideas. Castor generates code that uses type-safe extensible visitors, and largely removes boilerplate code typically associated with visitors. We illustrate the applicability of our approach with a case study modularizing the interpreters in the famous book ”Types and Programming Languages”.
Persistent Identifierhttp://hdl.handle.net/10722/301309
ISBN
ISI Accession Number ID

 

DC FieldValueLanguage
dc.contributor.authorZhang, W-
dc.contributor.authorDos Santos Oliveira, BC-
dc.date.accessioned2021-07-27T08:09:13Z-
dc.date.available2021-07-27T08:09:13Z-
dc.date.issued2018-
dc.identifier.citationProceedings of the 17th ACM SIGPLAN International Conference on Generative Programming: Concepts and Experiences (GPCE 2018), Boston, MA, USA, 5-6 November 2018, p. 134-146-
dc.identifier.isbn9781450360456-
dc.identifier.urihttp://hdl.handle.net/10722/301309-
dc.description.abstractPattern matching is a pervasive and useful feature in functional programming. There have been many attempts to bring similar notions to Object-Oriented Programming (OOP) in the past. However, a key challenge in OOP is how pattern matching can coexist with the open nature of OOP data structures, while at the same time guaranteeing other desirable properties for pattern matching. This paper discusses several desirable properties for pattern matching in an OOP context and shows how existing approaches are lacking some of these properties. We argue that the traditional semantics of pattern matching, which is based on the order of patterns and adopted by many approaches, is in conflict with the openness of data structures. Therefore we suggest that a more restricted, top-level pattern matching model, where the order of patterns is irrelevant, is worthwhile considering in an OOP context. To compensate for the absence of ordered patterns we propose a complementary mechanism for case analysis with defaults, which can be used when nested and/or multiple case analysis is needed. To illustrate our points we develop Castor: a meta-programming library inScala that adopts both ideas. Castor generates code that uses type-safe extensible visitors, and largely removes boilerplate code typically associated with visitors. We illustrate the applicability of our approach with a case study modularizing the interpreters in the famous book ”Types and Programming Languages”.-
dc.languageeng-
dc.publisherAssociation for Computing Machinery (ACM).-
dc.relation.ispartofProceedings of the 17th ACM SIGPLAN International Conference on Generative Programming: Concepts and Experiences-
dc.titlePattern matching in an open world-
dc.typeConference_Paper-
dc.identifier.emailDos Santos Oliveira, BC: bruno@cs.hku.hk-
dc.identifier.authorityDos Santos Oliveira, BC=rp01786-
dc.description.naturelink_to_subscribed_fulltext-
dc.identifier.doi10.1145/3278122.3278124-
dc.identifier.scopuseid_2-s2.0-85059017702-
dc.identifier.hkuros323726-
dc.identifier.spage134-
dc.identifier.epage146-
dc.identifier.isiWOS:000458143600011-
dc.publisher.placeNew York, NY-

Export via OAI-PMH Interface in XML Formats


OR


Export to Other Non-XML Formats