June 2022
Intermediate to advanced
130 pages
2h 45m
English
We’re going to start with atoms, a data type that might be confusing to Java, C, or C# developers. If you’re a Ruby developer, atoms are like symbols. If you come from Erlang, the data type is the atom.
Open up an IEx console and we’ll get right to work. So, what’s an atom?
| | iex> :atom |
| | :atom |
Atoms are names for concepts. Some good examples are :north, :string, and :yellow. Preface an atom with a colon, followed by a word starting with an alphabetic character.
You’re not limited to atoms with simple characters. By placing double quotes around the text to the right of the colon, you can make more complex atoms like :"blue-green" that would otherwise be invalid. In Elixir, we ...
Read now
Unlock full access