Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 1 addition & 14 deletions getting-started/pattern-matching.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -171,20 +171,7 @@ iex> {y, 1} = {2, 2}
** (MatchError) no match of right hand side value: {2, 2}
```

When using the pin operator in maps you must use the `=>` syntax when pinning a map's key, even when the value being pinned is an atom:

```iex
iex> k = :foo
:foo
iex> %{^k: v} = %{foo: "bar"}
** (SyntaxError) iex:11: syntax error before: k
iex> %{^k => v} = %{foo: "bar"}
%{foo: "bar"}
iex> v
"bar"
```

If a variable is mentioned more than once in a pattern, all references should bind to the same pattern:
If a variable is mentioned more than once in a pattern, all references should bind to the same value:

```iex
iex> {x, x} = {1, 1}
Expand Down