3 ms·
fn do true -> "true" false -> "false" _ -> "uh..." end
by throwawaymaths 3y ago
fn do
true -> "true"
false -> "false"
_ -> "uh..."
end
- sodapopcan 3y agoAs 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 https://hexdocs.pm/elixir/1.14/Kernel.SpecialForms.html#fn/1 [1] https://hexdocs.pm/elixir/1.14/Kernel.SpecialForms.html#cond/1 https://hexdocs.pm/elixir/1.14/Kernel.SpecialForms.html#cond...