5 ms·
You could do this with elixir? def print(true), do: IO.puts("true") def print(_), do: IO.puts("not true") In fact it's typically best practice to do this. I
by john_the_writer 4y ago
You could do this with elixir?
def print(true), do: IO.puts("true")
def print(_), do: IO.puts("not true")
In fact it's typically best practice to do this. I almost never write if statements in elixir. It makes chaining much easier.
value |> change_1() |> change_2() |> print()
- revskill 4y agoIs Elixir compile type safe ?
- john_the_writer 4y agoIt's compiled, but I wouldn't say it's perfectly type safe. My c++ background won't let me say that. It is close though.