Elixir seems like a great language. But what is/are the best convention(s) for declaring global constants?
I expect perhaps a module attribute may be the most appropriate solution?
Swapping the definitions for horizontal_line below fixes the compilation error.
defmodule ElixirTesting do
horizontal_line = String.duplicate("-", 80)
# def horizontal_line, do: String.duplicate("-", 80)
def test_global_constant do
IO.puts(horizontal_line)
IO.puts("Console Report Section Title")
IO.puts(horizontal_line)
true
end
end