concept unless in category elixir

appears as: unless
Elixir in Action

This is an excerpt from Manning's book Elixir in Action.

Due to its macro support and smart compiler architecture, most of Elixir is written in Elixir. Language constructs like if and unless and support for structures are implemented via Elixir macros. Only the smallest possible core is done in Erlang—everything else is then built on top of it in Elixir!

Multiclause solutions may not always be appropriate. Using them requires creating a separate function and passing the necessary arguments. Sometimes it’s simpler to use a classical branching construct in the function, and for such cases, the macros if, unless, cond, and case are provided. These work roughly as you might expect, although there are a couple of twists. Let’s look at each one of these constructs.