Tutorial by Examples

Elixir comes with integers and floating point numbers. An integer literal can be written in decimal, binary, octal and hexadecimal formats. iex> x = 291 291 iex> x = 0b100100011 291 iex> x = 0o443 291 iex> x = 0x123 291 As Elixir uses bignum arithmetic, the range of int...
Atoms are constants that represent a name of some thing. The value of an atom is it's name. An atom name starts with a colon. :atom # that's how we define an atom An atom's name is unique. Two atoms with the same names always are equal. iex(1)> a = :atom :atom iex(2)> b = :atom :at...
Binaries in elixir are created using the Kernel.SpecialForms construct <<>>. They are a powerful tool which makes Elixir very useful for working with binary protocols and encodings. Binaries and bitstrings are specified using a comma delimited list of integers or variable values, booke...

Page 1 of 1