I am learning Elixir and I can't seem to understand the usage of :. Following three lines illustrate this:
iex(1)> quote do: 1 + 3
{:+, [context: Elixir, import: Kernel], [1, 3]}
# no `:` but now I need `end`
iex(2)> quote do 1 + 3 end
{:+, [context: Elixir, import: Kernel], [1, 3]}
# Oops! an error
iex(3)> quote do: 1+ 2 end
** (SyntaxError) iex:10:16: unexpected reserved word: end
What does : do here? And why do I get a sytanx error if I use end with : as in third input above?
There is a question about atoms and colon in Elixir here, but it doesn't answer my question (at least to me).