I'm trying to get structs to work but none of the documented examples on the Internet or printed books work.
This example on the web site (https://www.tutorialspoint.com/elixir/elixir_structs.htm) also shows the same problem:
defmodule User do
defstruct name: "John", age: 27
end
john = %User{}
#To access name and age of John,
IO.puts(john.name)
IO.puts(john.age)
I get the error cannot access struct User, the struct was not yet defined or the struct is being accessed in the same context that defines it.