April 2024
Beginner to intermediate
224 pages
5h 7m
English
Elixir doesn’t have a normal assignment operator. In most languages, the = operator is used for simple left = "value" statements. In Elixir, this operator is called the match operator, and it initiates pattern matching.
Pattern matching is implemented by the BEAM, so it’s baked into the runtime of the language. Some optimizations make it efficient even for a large number of pattern clauses. So, you can use pattern matching without worrying about a negative performance impact on your application.
In this section, we’ll go over different pattern-matching syntaxes for basic data types, lists, maps, tuples, and more.
Let’s start with the most basic syntax for pattern matching. Open a new IEx session and ...
Read now
Unlock full access