Chapter 2Pattern Matching

  • pattern matching binds values to variables

  • matching handles structured data

  • _ (underscore) lets you ignore a match

We started the previous chapter by saying Elixir engenders a different way of thinking about programming.

To illustrate this and to lay the foundation for a lot of Elixir programming, let’s start reprogramming your brain by looking at something that’s one of the cornerstones of all programming languages—assignment.

Get Programming Elixir now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.