IO.write with \r
I can find no reference to this online. If you want to console.log a value without clogging up your logs, you can use \r
to replace the value in a string. In the example below, you do not get 1 million printouts. You get 1 printout that replaces the number 1 million times.
for x <- 1..1_000_000 do
IO.write("\rnum: " <> Integer.to_string(x))
end
Maybe I'm a noob and this is not just an elixir thing? It seems related to \n
for newline, so it might be a thing in general
Mix
- Remove old dependencies:
shell mix deps.clean --unlock --unused
Resources
- Elixir Lang
- https://elixir-lang.org/
- The Elixir homepage
- Elixir Hexdocs
- Elixir API documentation. It's the other Elixir homepage.
- https://hexdocs.pm/elixir/Kernel.html
- Elixir School
- https://elixirschool.com/en/
- Learner-oriented website teaching the fundamentals of particular topics.
- A Proposal for Context Rule