Pattern Matching

  • David Pollak

Abstract

So far, we’ve explored some of the basic functional cornerstones of Scala: immutable data types and the passing of functions as parameters. The third cornerstone of functional programming is pattern matching. At first glance, pattern matching looks like Java’s switch statement. However, pattern matching provides a powerful tool for declaring business logic in a concise and maintainable way. Scala blends traditional functional programming pattern matching with object-oriented concepts to provide a very powerful mechanism for writing programs.

Keywords

Sugar Covariance Encapsulation Dispatch Extractor 

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Copyright information

© David Pollak 2009

Authors and Affiliations

  • David Pollak

There are no affiliations available

Personalised recommendations