Proceedings of the 8th Symposium on Dynamic Languages 2012
DOI: 10.1145/2384577.2384581
|View full text |Cite
|
Sign up to set email alerts
|

Patterns as objects in grace

Abstract: Object orientation and pattern matching are often seen as conflicting approaches to program design. Object oriented programs place type-dependent behaviour inside objects and invoke it via dynamic dispatch, while pattern matching programs place type-dependent behaviour outside data structures and invoke it via multiway conditionals (case statements). Grace is a new, dynamic, object-oriented language designed to support teaching: to this end, Grace needs to support both styles. In this paper we explain how this… Show more

Help me understand this report

Search citation statements

Order By: Relevance

Paper Sections

Select...
2
1
1
1

Citation Types

0
11
0

Year Published

2013
2013
2017
2017

Publication Types

Select...
5
2
1

Relationship

2
6

Authors

Journals

citations
Cited by 23 publications
(11 citation statements)
references
References 12 publications
0
11
0
Order By: Relevance
“…This "patterns as objects" approach has been explored in several different languages [11,14,34,47]. Implementations differ in where bindings are stored and what is returned as a result, but in its most basic form it consists of the pattern interface with a virtual function match that accepts a subject and returns whether it was accepted or rejected.…”
Section: Methodsmentioning
confidence: 99%
See 1 more Smart Citation
“…This "patterns as objects" approach has been explored in several different languages [11,14,34,47]. Implementations differ in where bindings are stored and what is returned as a result, but in its most basic form it consists of the pattern interface with a virtual function match that accepts a subject and returns whether it was accepted or rejected.…”
Section: Methodsmentioning
confidence: 99%
“…The solution is remarkable in that unlike most of the library approaches to open pattern matching, it does not rely on naïve backtracking and, in fact, encodes the optimized algorithm based on backtracking automata [1,21]. Grace is another programming language that provides a library solution to pattern matching through objects [14]. Similar to other control structures in the language, Grace encodes the match statement with partial functions and lambda expressions, while patterns are encoded as objects.…”
Section: Related Workmentioning
confidence: 99%
“…Along with methods, types may be included as components of objects. Types have a runtime representation as a pattern [10] object.…”
Section: Objects In Gracementioning
confidence: 99%
“…Other language features (e.g. classes, traits and modules) are defined in terms of these concepts [4,17,18]. There are two mainstream implementations: a Grace to C compiler and a Grace to JavaScript transpiler.…”
Section: Introductionmentioning
confidence: 99%