Atoms In Elixir — Tentamen Software Testing Blog

Image for post
Image for post


We use atoms as constants that we assign to variables. Atom name consists of alphanumeric characters with _. We can also have an atom with spaces. Atom table is a table in BEAM where all atoms are stored. If two variables have the same atom value, they share that value. Doing that, Elixir’s programs are efficient regarding memory and performance.

Atom alias is when you name something with the first uppercase letter.

Image for post
Image for post

:true and :false are atoms reserved for Boolean value. All logical operators work with those two atoms. You can omit :

Image for post
Image for post

Nil in Elixir is also an atom: :nil == nil


  • atoms with spaces
  • why are atoms efficient
  • atom table
  • aliases
  • true and false are atoms because there is no Boolean type in Elixir
  • nil is also an atom

Originally published at on July 12, 2020.

Written by

Founder of Tentamen, software testing agency.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store