I am starting out with Elixir and I have some problems understanding the documentation at
https://hexdocs.pm/elixir/master/IO.html#inspect/2
-
According to the doc there is an inspect/2 and inspect/3 but no inspect/1. Therefore I expect that iex> IO.inspect 9 would return an error (no function with arity 1) however it does not. What am I missing?
-
What do the backslashes and square brackets imply in the documentation for inspect/1? Perhaps this answers the first question. I know square brackets mean a linked list, obviously, but I haven’t found a definition for the backslashes. This should be easier to look up in the documentation.
inspect(item, opts \\ [])
inspect(item, Keyword.t) :: item when item: var
Thanks for any input!