Elixir

Elixir

Installation

Ubuntu
apt install elixir
Arch Linux
pacman -S elixir
git

required erlang

git clone https://github.com/elixir-lang/elixir.git
cd elixir
make clean test
make install

Examples

Fibonacci Numbers
# Fibonacci Numbers
defmodule Fun do
    def fib(0), do: 0
    def fib(1), do: 1
    def fib(n) do
        fib(n-2) + fib(n-1)
    end
end

[n] = System.argv()
IO.puts Fun.fib(String.to_integer(n))

"""
    example
        elixir fib.ex 30
"""