3 ms·
You can accomplish iterations more concisely using other means, for example list operations in `Enum` [1]. Not too different from other modern languages often u
by weiming 7y ago
You can accomplish iterations more concisely using other means, for example list operations in `Enum` [1]. Not too different from other modern languages often using `foreach` vs. i-based iteration.
Also, try `IO.puts inspect foo` for printing stuff.
`IO.puts` can be compared to print() behavior in other languages
expecting toString() is fully implemented (`to_string` in this case for your custom typed data structs. [2][3])
[1] https://hexdocs.pm/elixir/Enum.html https://hexdocs.pm/elixir/Enum.html
[2] https://hexdocs.pm/elixir/String.Chars.html https://hexdocs.pm/elixir/String.Chars.html
[3] https://code.tutsplus.com/articles/polymorphism-with-protocols-in-elixir--cms-29081 https://code.tutsplus.com/articles/polymorphism-with-protoco...