Hi all
I have three potentially stupid questions totally unrelated to each other.
1. Macro names
So, the questions still stand: what can we set as macro names, and how to define operators? :)
2. Syntax inconsistency
I realize that "I should've read the docs and the source and understood metaprogramming better", but still...
I've learned to live with the fact that
f(a, b), do: function_body
but
f(a, b) do
function_body
end
(no comma, no colon in the second case) What I still don't understand is why, for instance, some stuff breaks the convention:
quote do: one_liner
quote do
multiple_lines
end
to show it together:
defmacro zz(a), do: quote do: unquote a
This makes me consistently keep track of commas, colons and keep in mind what I'm dealing with: one-liners? multi-liners? macros? any combination of those?
3. Filename extension inconsistency
All files are *.ex, and mix compile will only compile *.ex
mix test requires files to have a .exs extension, and won't even look at *.ex
Why? This caused me a couple of grey hairs when I couldn't understand why mix test wouldn't pick up my newly written tests. mix test path/to/file works perfectly though.
Please, don't kill me :)