Pattern Matching

Stijn Mostinckx

Research topic which contemplates the extension of AmbientTalk’s type tag system, such that type tags can have optional arguments. These arguments can be used to deconstruct objects in pattern matching expressions as will be shown below.

Pattern matching rules can be applied to:

Objects Matching a single object against a set of pattern matching rules can be used to distinguish based on its value type. This can be used for instance to easily perform an external tree traversal.
Collections Matching a collection against a set of rules can be used to filter or split that collection. As is illustrated below, it can also be used to pair elements of that collection, etc.

It is also worth noting that reactive objects and collections can also be matched against a set of pattern matching rules. Hence, if an application’s context is modeled as a reactive collection, this is an expressive means to determine its window on the world.

Pattern matching in AmbientTalk

Object Matching
Collection Matching

Pattern Matching in AmbientTalk/R

Object Matching
Collection Matching
research/patterns.txt · Last modified: 2010/07/31 18:59 by stijnm
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki