Created
January 19, 2019 23:02
-
-
Save Tombarr/20fce983fb7b53e294d1dd45dfd8aa8a to your computer and use it in GitHub Desktop.
Destructuring using pattern matching in Elixir
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[x, y, z] = [1, 2, 3] | |
{status, message} = {:error, "Unknown error"} | |
[first | everythingElse] = [1, 2, 3, 4, 5] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment