4 ms·
One thing I love about Elixir's syntax is that virtually everything is a call, take the if statement: if condition do IO.puts "true" :yes else
by calo_star 4y ago
One thing I love about Elixir's syntax is that virtually everything is a call, take the if statement:
if condition do
IO.puts "true"
:yes
else
IO.puts "false"
:no
end
is just a call to the *Kernel.if/2* macro:
if(true, do: (IO.puts("true"); :yes), else: (IO.puts("false"); :no))
I was joyous when I realized I could pipe stuff into a case statement.