Minha jornada (até agora) com Elixir

exemplo de output do comando deps.get
mix.exs do projeto Elixir Koans
output do comando mix meditate
lista de features abordadas pelo Koans
iex> string = "\u0061\u0301"
"á"

iex> String.codepoints(string)
["a", "́"]

iex> String.graphemes(string)
["á"]
iex> div(10, 2)
5
iex> div 10, 2
5
iex> rem 10, 3
1
iex> :apple
:apple
iex> :orange
:orange
iex> :apple == :apple
true
iex> :apple == :orange
false
iex> true == :true
true
iex> is_atom(false)
true
iex> is_boolean(:false)
true
iex> tuple = {:ok, "hello"}
{:ok, "hello"}
iex> elem(tuple, 1) #funcão que retorna o valor no indice 1 da tupla
"hello"
iex> tuple_size(tuple)
2
iex(5)> list = [0,2,4]
[0, 2, 4]
iex(6)> list ++ [9]
[0, 2, 4, 9]
iex(7)> list -- [2]
[0, 4]

--

--

--

Escritor-Desenvolvedor

Love podcasts or audiobooks? Learn on the go with our new app.

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
Adriano Croco

Adriano Croco

Escritor-Desenvolvedor

More from Medium

Intro to Elixir Functions

How to Enable File Uploads with Phoenix LiveView

Phoenix Auth with SurfaceBulma

Elixir tap and then macros — life-saving helpers