Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: