May 2018
Intermediate to advanced
412 pages
9h 3m
English
We cover:
Once a program grows beyond a couple of lines, you’ll want to structure it. Elixir makes this easy. You break your code into named functions and organize these functions into modules. In fact, in Elixir named functions must be written inside modules.
Let’s look at a simple example. Navigate to a working directory and create an Elixir source file called times.exs.
| | defmodule Times do |
| | def double(n) do |
| | n * 2 |
| | end |
| | end |
Here we have a module named Times. It contains a single function, double. Because our function takes ...
Read now
Unlock full access