We cover:

  • How pattern matching binds values to variables
  • How matching handles structured data
  • How _ (underscore) lets you ignore a match

Chapter 2Pattern Matching

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 one of the cornerstones of all programming languages—assignment.

Get Programming Elixir ≥ 1.6 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.