I’ve been playing with Elixir lately and wanted to persist a few things that I thought were interesting about some of it’s core data types. It’s very basic, but if you’re just getting started with Elixir like I am, you might find these notes interesting.
Elixir has a few of the basic types you’d expect to see in any other language. For example, Elixir has integers, floats and strings. Besides those types, there are atoms (aka. symbols), lists and tuples.
Atoms look just like symbols in Ruby. They are constants whose name is also it’s value.
1 2 3 4 5 6
Another interesting note is that booleans are just atoms.
1 2 3 4
Lists in Elixir are linked lists. A linked list is data structure in which each node contains a reference to the next node.