Into Flashcards
IEX
Elixirs interactive Shell
3 new command line executables
IEX - opens up interactive elixir
IEX.bat on windows PowerShell
Elixir -
Elixirs -
Integer
1,
0x1F
Float
1.0
Boolean
True
False
Atom
:atom
A constant whose value is its own name
:Apple —> :Apple
String
“Elixir”
List
[1, 2, 3]
Tuple
{1, 2, 3}
/
Division
Always returns float
Div(10,2)
—> 5
Not a float
rem(10,3)
—> 1
Round(3.58)
—> 4
Trunc(3.58)
—> 3
Is_integer(1)
Is_integer(2.0)
—> true
—> false
Arity
Trunc/1
The arity of a function describes the number of arguments it takes.
Refers to the Trunc function with an arity of 1
Kernel
Defines general use functions
Is automatically imported into a namespace
Nil || true
True || 1
Nil && 13
True
True
Nil
Nil
Represents the absence of a value
Is_atom(false)
Is_boolean(:false)
—> true
—> true
<>
Concatenate two strings
“Hello #{“world”}”
Hello world
IO.puts()
Prints a string
—> :ok
String.length()
String.upcase()