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

    fn do
      true -> "true"
      false -> "false"
      _ -> "uh..."
    end


As much as I despise people responding in pure code, you're right, it's technically `fn/1` [0]. Even though the docs say `fn(clauses)`, `cond/1`, which requires the `do`, also says `cond(clauses)` [1] so looks like I'm wrong.

[0] https://hexdocs.pm/elixir/1.14/Kernel.SpecialForms.html#fn/1

[1] https://hexdocs.pm/elixir/1.14/Kernel.SpecialForms.html#cond...




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

Search: