Composing macros (using a macro inside another macro)

:man_facepalming: right…

Why doesn’t this work?

defmodule Test do
  defmacro somemacro(arg1, do: block) do
    quote do
      defmodule unquote(arg1) do 
        def unquote(arg1), do: 1
        unquote(block)      
      end
    end
  end

  defmacro othermacro(arg2, arg1, do: block) do
    somemacro arg1, do: quote do
      def unquote(arg2), do: 2
      unquote(block)
    end
  end
end

Is it because the unquote is evaluated after being passed into somemacro?